fix: need to add lifecycle hook to start tusWorker
This commit is contained in:
parent
d88638dfc3
commit
9a87004f31
|
@ -74,14 +74,23 @@ func (s *StorageServiceDefault) Start() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewStorageService(params StorageServiceParams) *StorageServiceDefault {
|
func NewStorageService(lc fx.Lifecycle, params StorageServiceParams) *StorageServiceDefault {
|
||||||
return &StorageServiceDefault{
|
ss := &StorageServiceDefault{
|
||||||
config: params.Config,
|
config: params.Config,
|
||||||
logger: params.Logger,
|
logger: params.Logger,
|
||||||
db: params.Db,
|
db: params.Db,
|
||||||
accounts: params.Accounts,
|
accounts: params.Accounts,
|
||||||
cron: params.Cron,
|
cron: params.Cron,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
lc.Append(fx.Hook{
|
||||||
|
OnStart: func(ctx context.Context) error {
|
||||||
|
go ss.tusWorker()
|
||||||
|
return nil
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
return ss
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s StorageServiceDefault) PutFileSmall(file io.ReadSeeker, bucket string, generateProof bool) ([]byte, error) {
|
func (s StorageServiceDefault) PutFileSmall(file io.ReadSeeker, bucket string, generateProof bool) ([]byte, error) {
|
||||||
|
|
Loading…
Reference in New Issue