refactor: don't block price updates, but do fatal on error
This commit is contained in:
parent
8c05180703
commit
effb341418
|
@ -213,17 +213,17 @@ func (p PriceTracker) init() error {
|
|||
p.cron.RegisterService(p)
|
||||
p.api = apisdkgo.NewSiaClient()
|
||||
|
||||
go func() {
|
||||
err := p.importPrices()
|
||||
if err != nil {
|
||||
p.logger.Error("failed to import prices", zap.Error(err))
|
||||
return err
|
||||
p.logger.Fatal("failed to import prices", zap.Error(err))
|
||||
}
|
||||
|
||||
err = p.updatePrices()
|
||||
if err != nil {
|
||||
p.logger.Error("failed to update prices", zap.Error(err))
|
||||
return err
|
||||
p.logger.Fatal("failed to update prices", zap.Error(err))
|
||||
}
|
||||
}()
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue