cron.delete_old_actions does not respect (low?) values #14607

Closed
opened 2025-11-02 11:17:24 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @KiGamji on GitHub (Jun 15, 2025).

Description

According to the docs:

Cron - Delete all old actions from database (cron.delete_old_actions)

    ENABLED: false: Enable service.
    RUN_AT_START: false: Run tasks at start up time (if ENABLED).
    NOTICE_ON_SUCCESS: false: Set to true to switch on success notices.
    SCHEDULE: @every 168h: Cron syntax to set how often to check.
    OLDER_THAN: 8760h: any action older than this expression will be deleted from database, suggest using 8760h (1 year) because that's the max length of heatmap.

If I get it right, setting OLDER_THAN to 1h would make it clean any actions older than 1 hour.
With the following testing configuration:

[cron.delete_old_actions]
ENABLED = true
RUN_AT_START = true
OLDER_THAN = 1h
NOTICE_ON_SUCCESS = true

It runs successfully both automatically and manually:

Image

However, in my test repo with recent actions, there are still older ones undeleted:

Image

Gitea Version

1.24.0

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

Docker (image: gitea/gitea)

Database

PostgreSQL

Originally created by @KiGamji on GitHub (Jun 15, 2025). ### Description According to the docs: ``` Cron - Delete all old actions from database (cron.delete_old_actions) ENABLED: false: Enable service. RUN_AT_START: false: Run tasks at start up time (if ENABLED). NOTICE_ON_SUCCESS: false: Set to true to switch on success notices. SCHEDULE: @every 168h: Cron syntax to set how often to check. OLDER_THAN: 8760h: any action older than this expression will be deleted from database, suggest using 8760h (1 year) because that's the max length of heatmap. ``` If I get it right, setting `OLDER_THAN` to 1h would make it clean any actions older than 1 hour. With the following testing configuration: ``` [cron.delete_old_actions] ENABLED = true RUN_AT_START = true OLDER_THAN = 1h NOTICE_ON_SUCCESS = true ``` It runs successfully both automatically and manually: ![Image](https://github.com/user-attachments/assets/227df5f5-ca93-4300-ac60-025e74ea566d) However, in my test repo with recent actions, there are still older ones undeleted: ![Image](https://github.com/user-attachments/assets/248a926b-a6be-4e40-b1a6-5cbc533203aa) ### Gitea Version 1.24.0 ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version _No response_ ### Operating System _No response_ ### How are you running Gitea? Docker (image: gitea/gitea) ### Database PostgreSQL
GiteaMirror added the type/bug label 2025-11-02 11:17:24 -06:00
Author
Owner

@KiGamji commented on GitHub (Jun 15, 2025):

nevermind lmao, that's for dashboard actions page. if someone finds this, see #24256, namely LOG_RETENTION_DAYS and ARTIFACT_RETENTION_DAYS

@KiGamji commented on GitHub (Jun 15, 2025): nevermind lmao, that's for dashboard actions page. if someone finds this, see #24256, namely `LOG_RETENTION_DAYS` and `ARTIFACT_RETENTION_DAYS`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#14607