mirror of
https://github.com/harness/drone.git
synced 2025-05-19 02:20:03 +08:00
Fix repo sizing job cron (#948)
This commit is contained in:
parent
7ff83849aa
commit
18c81b04b4
@ -103,6 +103,10 @@ func worker(ctx context.Context, c *Calculator, wg *sync.WaitGroup, taskCh <-cha
|
||||
log.Error().Msgf("failed to get repo size: %s", err.Error())
|
||||
continue
|
||||
}
|
||||
if sizeOut.Size == sizeInfo.Size {
|
||||
log.Debug().Msg("repo size not changed")
|
||||
continue
|
||||
}
|
||||
|
||||
if err := c.repoStore.UpdateSize(ctx, sizeInfo.ID, sizeOut.Size); err != nil {
|
||||
log.Error().Msgf("failed to update repo size: %s", err.Error())
|
||||
|
@ -312,7 +312,7 @@ type Config struct {
|
||||
|
||||
RepoSize struct {
|
||||
Enabled bool `envconfig:"GITNESS_REPO_SIZE_ENABLED" default:"true"`
|
||||
CRON string `envconfig:"GITNESS_REPO_SIZE_CRON" default:"* * 0 * * * *"`
|
||||
CRON string `envconfig:"GITNESS_REPO_SIZE_CRON" default:"0 0 * * *"`
|
||||
MaxDuration time.Duration `envconfig:"GITNESS_REPO_SIZE_MAX_DURATION" default:"15m"`
|
||||
NumWorkers int `envconfig:"GITNESS_REPO_SIZE_NUM_WORKERS" default:"5"`
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user