refactor: move price tracker init to a lifecycle
This commit is contained in:
parent
21ae6d093d
commit
8c05180703
|
@ -61,8 +61,14 @@ var Module = fx.Module("renter",
|
|||
fx.Invoke(func(r *RenterDefault) error {
|
||||
return r.init()
|
||||
}),
|
||||
fx.Invoke(func(r *PriceTracker) error {
|
||||
return r.init()
|
||||
fx.Invoke(func(lc fx.Lifecycle, r *PriceTracker) error {
|
||||
lc.Append(fx.Hook{
|
||||
OnStart: func(ctx context.Context) error {
|
||||
return r.init()
|
||||
|
||||
},
|
||||
})
|
||||
return nil
|
||||
}),
|
||||
),
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue