refactor: move price tracker init to a lifecycle

This commit is contained in:
Derrick Hammer 2024-03-10 13:29:43 -04:00
parent 21ae6d093d
commit 8c05180703
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 8 additions and 2 deletions

View File

@ -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
}),
),
)