mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-09-15 18:56:59 +00:00
fix: ignore expired artifacts for quota calculation (#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. Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7976 Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org> Reviewed-by: Otto <otto@codeberg.org> Co-authored-by: Gusted <postmaster@gusted.xyz> Co-committed-by: Gusted <postmaster@gusted.xyz>
This commit is contained in:
parent
e78d1c8210
commit
022eeee657
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