]> git.immae.eu Git - perso/Immae/Projets/Cryptomonnaies/Cryptoportfolio/Front.git/blame - api/markets.go
Set session expire to 7 days.
[perso/Immae/Projets/Cryptomonnaies/Cryptoportfolio/Front.git] / api / markets.go
CommitLineData
2f91f20a 1package api
2
3import (
4 "immae.eu/Immae/Projets/Cryptomonnaies/Cryptoportfolio/Front/markets"
5)
6
7var Poloniex *markets.Poloniex
8
9func OpenMarketsConnection() error {
10 for {
11 err := Poloniex.StartTicker()
12 if err != nil {
13 return err
14 }
15 log.Warn("connection to poloniex stream ended, restarting it...")
16 }
17}
18
19func init() {
20 Poloniex = markets.NewPoloniex()
21
22 // We open markets connections in the background as it can take time.
23 go func() {
24 err := OpenMarketsConnection()
25 if err != nil {
26 ErrorChan <- err
27 }
28 }()
29}