Skip to content

Commit

Permalink
Specify unit in duration
Browse files Browse the repository at this point in the history
  • Loading branch information
ishank011 committed Feb 24, 2021
1 parent 8be838f commit efc9f78
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pkg/cbox/publicshare/sql/sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func (c *config) init() {
}

func (m *manager) startJanitorRun() {
ticker := time.NewTicker(time.Duration(m.c.JanitorRunInterval))
ticker := time.NewTicker(time.Duration(m.c.JanitorRunInterval) * time.Second)
work := make(chan os.Signal, 1)
signal.Notify(work, syscall.SIGHUP, syscall.SIGINT, syscall.SIGQUIT)

Expand Down
13 changes: 7 additions & 6 deletions pkg/publicshare/manager/json/json.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,12 @@ func New(c map[string]interface{}) (publicshare.Manager, error) {
conf.init()

m := manager{
mutex: &sync.Mutex{},
marshaler: jsonpb.Marshaler{},
unmarshaler: jsonpb.Unmarshaler{},
file: conf.File,
passwordHashCost: conf.SharePasswordHashCost,
mutex: &sync.Mutex{},
marshaler: jsonpb.Marshaler{},
unmarshaler: jsonpb.Unmarshaler{},
file: conf.File,
passwordHashCost: conf.SharePasswordHashCost,
janitorRunInterval: conf.JanitorRunInterval,
}

// attempt to create the db file
Expand Down Expand Up @@ -124,7 +125,7 @@ type manager struct {
}

func (m *manager) startJanitorRun() {
ticker := time.NewTicker(time.Duration(m.janitorRunInterval))
ticker := time.NewTicker(time.Duration(m.janitorRunInterval) * time.Second)
work := make(chan os.Signal, 1)
signal.Notify(work, syscall.SIGHUP, syscall.SIGINT, syscall.SIGQUIT)

Expand Down

0 comments on commit efc9f78

Please sign in to comment.