Skip to content

Commit 8df3d65

Browse files
authored
Change @every 24h default schedules to @midnight (#16431)
1 parent 195c999 commit 8df3d65

File tree

4 files changed

+23
-23
lines changed

4 files changed

+23
-23
lines changed

custom/conf/app.example.ini

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1671,7 +1671,7 @@ PATH =
16711671
;; Notice if not success
16721672
;NO_SUCCESS_NOTICE = false
16731673
;; Time interval for job to run
1674-
;SCHEDULE = @every 24h
1674+
;SCHEDULE = @midnight
16751675
;; Archives created more than OLDER_THAN ago are subject to deletion
16761676
;OLDER_THAN = 24h
16771677

@@ -1697,7 +1697,7 @@ PATH =
16971697
;[cron.repo_health_check]
16981698
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
16991699
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1700-
;SCHEDULE = @every 24h
1700+
;SCHEDULE = @midnight
17011701
;; Enable running Repository health check task periodically.
17021702
;ENABLED = true
17031703
;; Run Repository health check task when Gitea starts.
@@ -1722,7 +1722,7 @@ PATH =
17221722
;RUN_AT_START = true
17231723
;; Notice if not success
17241724
;NO_SUCCESS_NOTICE = false
1725-
;SCHEDULE = @every 24h
1725+
;SCHEDULE = @midnight
17261726

17271727
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
17281728
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -1736,7 +1736,7 @@ PATH =
17361736
;; Notice if not success
17371737
;NO_SUCCESS_NOTICE = false
17381738
;; Interval as a duration between each synchronization. (default every 24h)
1739-
;SCHEDULE = @every 24h
1739+
;SCHEDULE = @midnight
17401740

17411741
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
17421742
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -1751,7 +1751,7 @@ PATH =
17511751
;; Notice if not success
17521752
;NO_SUCCESS_NOTICE = false
17531753
;; Interval as a duration between each synchronization (default every 24h)
1754-
;SCHEDULE = @every 24h
1754+
;SCHEDULE = @midnight
17551755
;; Create new users, update existing user data and disable users that are not in external source anymore (default)
17561756
;; or only create new users if UPDATE_EXISTING is set to false
17571757
;UPDATE_EXISTING = true
@@ -1769,7 +1769,7 @@ PATH =
17691769
;; Notice if not success
17701770
;NO_SUCCESS_NOTICE = false
17711771
;; Interval as a duration between each synchronization (default every 24h)
1772-
;SCHEDULE = @every 24h
1772+
;SCHEDULE = @midnight
17731773
;; deleted branches than OLDER_THAN ago are subject to deletion
17741774
;OLDER_THAN = 24h
17751775

@@ -1785,7 +1785,7 @@ PATH =
17851785
;; Whether to always run at start up time (if ENABLED)
17861786
;RUN_AT_START = false
17871787
;; Time interval for job to run
1788-
;SCHEDULE = @every 24h
1788+
;SCHEDULE = @midnight
17891789
;; OlderThan or PerWebhook. How the records are removed, either by age (i.e. how long ago hook_task record was delivered) or by the number to keep per webhook (i.e. keep most recent x deliveries per webhook).
17901790
;CLEANUP_TYPE = OlderThan
17911791
;; If CLEANUP_TYPE is set to OlderThan, then any delivered hook_task records older than this expression will be deleted.

docs/content/doc/advanced/config-cheat-sheet.en-us.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,7 @@ NB: You must have `DISABLE_ROUTER_LOG` set to `false` for this option to take ef
740740

741741
- `ENABLED`: **true**: Enable service.
742742
- `RUN_AT_START`: **true**: Run tasks at start up time (if ENABLED).
743-
- `SCHEDULE`: **@every 24h**: Cron syntax for scheduling repository archive cleanup, e.g. `@every 1h`.
743+
- `SCHEDULE`: **@midnight**: Cron syntax for scheduling repository archive cleanup, e.g. `@every 1h`.
744744
- `OLDER_THAN`: **24h**: Archives created more than `OLDER_THAN` ago are subject to deletion, e.g. `12h`.
745745

746746
#### Cron - Update Mirrors (`cron.update_mirrors`)
@@ -750,31 +750,31 @@ NB: You must have `DISABLE_ROUTER_LOG` set to `false` for this option to take ef
750750

751751
#### Cron - Repository Health Check (`cron.repo_health_check`)
752752

753-
- `SCHEDULE`: **@every 24h**: Cron syntax for scheduling repository health check.
753+
- `SCHEDULE`: **@midnight**: Cron syntax for scheduling repository health check.
754754
- `TIMEOUT`: **60s**: Time duration syntax for health check execution timeout.
755755
- `ARGS`: **\<empty\>**: Arguments for command `git fsck`, e.g. `--unreachable --tags`. See more on http://git-scm.com/docs/git-fsck
756756

757757
#### Cron - Repository Statistics Check (`cron.check_repo_stats`)
758758

759759
- `RUN_AT_START`: **true**: Run repository statistics check at start time.
760-
- `SCHEDULE`: **@every 24h**: Cron syntax for scheduling repository statistics check.
760+
- `SCHEDULE`: **@midnight**: Cron syntax for scheduling repository statistics check.
761761

762762
### Cron - Cleanup hook_task Table (`cron.cleanup_hook_task_table`)
763763

764764
- `ENABLED`: **true**: Enable cleanup hook_task job.
765765
- `RUN_AT_START`: **false**: Run cleanup hook_task at start time (if ENABLED).
766-
- `SCHEDULE`: **@every 24h**: Cron syntax for cleaning hook_task table.
766+
- `SCHEDULE`: **@midnight**: Cron syntax for cleaning hook_task table.
767767
- `CLEANUP_TYPE` **OlderThan** OlderThan or PerWebhook Method to cleanup hook_task, either by age (i.e. how long ago hook_task record was delivered) or by the number to keep per webhook (i.e. keep most recent x deliveries per webhook).
768768
- `OLDER_THAN`: **168h**: If CLEANUP_TYPE is set to OlderThan, then any delivered hook_task records older than this expression will be deleted.
769769
- `NUMBER_TO_KEEP`: **10**: If CLEANUP_TYPE is set to PerWebhook, this is number of hook_task records to keep for a webhook (i.e. keep the most recent x deliveries).
770770

771771
#### Cron - Update Migration Poster ID (`cron.update_migration_poster_id`)
772772

773-
- `SCHEDULE`: **@every 24h** : Interval as a duration between each synchronization, it will always attempt synchronization when the instance starts.
773+
- `SCHEDULE`: **@midnight** : Interval as a duration between each synchronization, it will always attempt synchronization when the instance starts.
774774

775775
#### Cron - Sync External Users (`cron.sync_external_users`)
776776

777-
- `SCHEDULE`: **@every 24h** : Interval as a duration between each synchronization, it will always attempt synchronization when the instance starts.
777+
- `SCHEDULE`: **@midnight** : Interval as a duration between each synchronization, it will always attempt synchronization when the instance starts.
778778
- `UPDATE_EXISTING`: **true**: Create new users, update existing user data and disable users that are not in external source anymore (default) or only create new users if UPDATE_EXISTING is set to false.
779779

780780
### Extended cron tasks (not enabled by default)

docs/content/doc/advanced/config-cheat-sheet.zh-cn.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,18 +257,18 @@ test01.xls: application/vnd.ms-excel; charset=binary
257257

258258
### Cron - Repository Health Check (`cron.repo_health_check`)
259259

260-
- `SCHEDULE`: 仓库健康监测的Cron语法,比如:`@every 24h`
260+
- `SCHEDULE`: 仓库健康监测的Cron语法,比如:`@midnight`
261261
- `TIMEOUT`: 仓库健康监测的超时时间,比如:`60s`.
262262
- `ARGS`: 执行 `git fsck` 命令的参数,比如:`--unreachable --tags`
263263

264264
### Cron - Repository Statistics Check (`cron.check_repo_stats`)
265265

266266
- `RUN_AT_START`: 是否启动时自动运行仓库统计。
267-
- `SCHEDULE`: 仓库统计时的Cron 语法,比如:`@every 24h`.
267+
- `SCHEDULE`: 仓库统计时的Cron 语法,比如:`@midnight`.
268268

269269
### Cron - Update Migration Poster ID (`cron.update_migration_poster_id`)
270270

271-
- `SCHEDULE`: **@every 24h** : 每次同步的间隔时间。此任务总是在启动时自动进行。
271+
- `SCHEDULE`: **@midnight** : 每次同步的间隔时间。此任务总是在启动时自动进行。
272272

273273
## Git (`git`)
274274

modules/cron/tasks_basic.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func registerRepoHealthCheck() {
3636
BaseConfig: BaseConfig{
3737
Enabled: true,
3838
RunAtStart: false,
39-
Schedule: "@every 24h",
39+
Schedule: "@midnight",
4040
},
4141
Timeout: 60 * time.Second,
4242
Args: []string{},
@@ -50,7 +50,7 @@ func registerCheckRepoStats() {
5050
RegisterTaskFatal("check_repo_stats", &BaseConfig{
5151
Enabled: true,
5252
RunAtStart: true,
53-
Schedule: "@every 24h",
53+
Schedule: "@midnight",
5454
}, func(ctx context.Context, _ *models.User, _ Config) error {
5555
return models.CheckRepoStats(ctx)
5656
})
@@ -61,7 +61,7 @@ func registerArchiveCleanup() {
6161
BaseConfig: BaseConfig{
6262
Enabled: true,
6363
RunAtStart: true,
64-
Schedule: "@every 24h",
64+
Schedule: "@midnight",
6565
},
6666
OlderThan: 24 * time.Hour,
6767
}, func(ctx context.Context, _ *models.User, config Config) error {
@@ -75,7 +75,7 @@ func registerSyncExternalUsers() {
7575
BaseConfig: BaseConfig{
7676
Enabled: true,
7777
RunAtStart: false,
78-
Schedule: "@every 24h",
78+
Schedule: "@midnight",
7979
},
8080
UpdateExisting: true,
8181
}, func(ctx context.Context, _ *models.User, config Config) error {
@@ -89,7 +89,7 @@ func registerDeletedBranchesCleanup() {
8989
BaseConfig: BaseConfig{
9090
Enabled: true,
9191
RunAtStart: true,
92-
Schedule: "@every 24h",
92+
Schedule: "@midnight",
9393
},
9494
OlderThan: 24 * time.Hour,
9595
}, func(ctx context.Context, _ *models.User, config Config) error {
@@ -103,7 +103,7 @@ func registerUpdateMigrationPosterID() {
103103
RegisterTaskFatal("update_migration_poster_id", &BaseConfig{
104104
Enabled: true,
105105
RunAtStart: true,
106-
Schedule: "@every 24h",
106+
Schedule: "@midnight",
107107
}, func(ctx context.Context, _ *models.User, _ Config) error {
108108
return migrations.UpdateMigrationPosterID(ctx)
109109
})
@@ -114,7 +114,7 @@ func registerCleanupHookTaskTable() {
114114
BaseConfig: BaseConfig{
115115
Enabled: true,
116116
RunAtStart: false,
117-
Schedule: "@every 24h",
117+
Schedule: "@midnight",
118118
},
119119
CleanupType: "OlderThan",
120120
OlderThan: 168 * time.Hour,

0 commit comments

Comments
 (0)