mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-09-29 14:15:55 +00:00
[v11.0/forgejo] fix: ignore expired artifacts for quota calculation (#7985)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/7976 - Expired artifacts are kept in the database but the artifact has been deleted from the storage. Ignore them for the quota calculation. - Added unit test. Co-authored-by: Gusted <postmaster@gusted.xyz> Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7985 Reviewed-by: Gusted <gusted@noreply.codeberg.org> Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org> Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
This commit is contained in:
parent
e9f0e96a27
commit
ed87ecd17f
4 changed files with 61 additions and 1 deletions
|
@ -131,7 +131,8 @@ func createQueryFor(ctx context.Context, userID int64, q string) db.Engine {
|
|||
case "artifacts":
|
||||
session = session.
|
||||
Table("action_artifact").
|
||||
Join("INNER", "`repository`", "`action_artifact`.repo_id = `repository`.id")
|
||||
Join("INNER", "`repository`", "`action_artifact`.repo_id = `repository`.id").
|
||||
Where("`action_artifact`.status != ?", action_model.ArtifactStatusExpired)
|
||||
case "packages":
|
||||
session = session.
|
||||
Table("package_version").
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue