Skip to content
This repository has been archived by the owner on Apr 5, 2024. It is now read-only.

Commit

Permalink
Actually use the parsed cron-interval, rather than a constant.
Browse files Browse the repository at this point in the history
  • Loading branch information
CryptoCopter committed Mar 13, 2023
1 parent cb7074a commit dc78aab
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/dtnd/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,15 +309,15 @@ func parseCron(config cronConf, c *routing.Core) (*routing.Cron, error) {
if err != nil {
return nil, NewConfigError(fmt.Sprintf("Error parsing duration: %v", config.CleanStore), err)
}
if err := cron.Register("clean_store", c.Store.DeleteExpired, 10*time.Minute); err != nil {
if err := cron.Register("clean_store", c.Store.DeleteExpired, interval); err != nil {
return nil, NewConfigError("Failed to register clean_store at cron", err)
}

interval, err = time.ParseDuration(config.CleanID)
if err != nil {
return nil, NewConfigError(fmt.Sprintf("Error parsing duration: %v", config.CleanID), err)
}
if err := cron.Register("clean_ids", c.IdKeeper.Clean, 10*time.Minute); err != nil {
if err := cron.Register("clean_ids", c.IdKeeper.Clean, interval); err != nil {
return nil, NewConfigError("Failed to register clean_ids at cron", err)
}

Expand Down

0 comments on commit dc78aab

Please sign in to comment.