mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-17 11:59:30 +00:00
Cron job to cleanup hook_task table (#13080)
Close **Prune hook_task Table (#10741)** Added a cron job to delete webhook deliveries in the hook_task table. It can be turned on/off and the schedule controlled globally via app.ini. The data can be deleted by either the age of the delivery which is the default or by deleting the all but the most recent deliveries _per webhook_. Note: I had previously submitted pr #11416 but I closed it when I realized that I had deleted per repository instead of per webhook. Also, I decided allowing the settings to be overridden via the ui was overkill. Also this version allows the deletion by age which is probably what most people would want.
This commit is contained in:
parent
0f726caf97
commit
a598877fdf
7 changed files with 251 additions and 0 deletions
|
@ -1023,6 +1023,21 @@ SCHEDULE = @every 24h
|
|||
; deleted branches than OLDER_THAN ago are subject to deletion
|
||||
OLDER_THAN = 24h
|
||||
|
||||
; Cleanup hook_task table
|
||||
[cron.cleanup_hook_task_table]
|
||||
; Whether to enable the job
|
||||
ENABLED = true
|
||||
; Whether to always run at start up time (if ENABLED)
|
||||
RUN_AT_START = false
|
||||
; Time interval for job to run
|
||||
SCHEDULE = @every 24h
|
||||
; 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).
|
||||
CLEANUP_TYPE = OlderThan
|
||||
; If CLEANUP_TYPE is set to OlderThan, then any delivered hook_task records older than this expression will be deleted.
|
||||
OLDER_THAN = 168h
|
||||
; 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).
|
||||
NUMBER_TO_KEEP = 10
|
||||
|
||||
; Extended cron task - not enabled by default
|
||||
|
||||
; Delete all unactivated accounts
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue