feat(cron): add cron scheduler
This commit is contained in:
parent
0dfa09033e
commit
0962ddb57c
4 changed files with 32 additions and 12 deletions
|
@ -4,6 +4,7 @@ import (
|
|||
"github.com/ihexxa/gocfg"
|
||||
"go.uber.org/zap"
|
||||
|
||||
"github.com/ihexxa/quickshare/src/cron"
|
||||
"github.com/ihexxa/quickshare/src/cryptoutil"
|
||||
"github.com/ihexxa/quickshare/src/db/boltstore"
|
||||
"github.com/ihexxa/quickshare/src/db/fileinfostore"
|
||||
|
@ -36,6 +37,7 @@ type Deps struct {
|
|||
limiter iolimiter.ILimiter
|
||||
workers worker.IWorkerPool
|
||||
boltStore *boltstore.BoltStore
|
||||
cron cron.ICron
|
||||
}
|
||||
|
||||
func NewDeps(cfg gocfg.ICfg) *Deps {
|
||||
|
@ -129,3 +131,11 @@ func (deps *Deps) BoltStore() *boltstore.BoltStore {
|
|||
func (deps *Deps) SetBoltStore(boltStore *boltstore.BoltStore) {
|
||||
deps.boltStore = boltStore
|
||||
}
|
||||
|
||||
func (deps *Deps) Cron() cron.ICron {
|
||||
return deps.cron
|
||||
}
|
||||
|
||||
func (deps *Deps) SetCron(cronImp cron.ICron) {
|
||||
deps.cron = cronImp
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue