You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR adds a task to the cron service to allow garbage collection of
LFS meta objects. As repositories may have a large number of
LFSMetaObjects, an updated column is added to this table and it is used
to perform a generational GC to attempt to reduce the amount of work.
(There may need to be a bit more work here but this is probably enough
for the moment.)
Fix#7045
Signed-off-by: Andrew Thornton <art27@cantab.net>
Copy file name to clipboardExpand all lines: docs/content/doc/advanced/config-cheat-sheet.en-us.md
+10
Original file line number
Diff line number
Diff line change
@@ -1039,6 +1039,16 @@ Default templates for project boards:
1039
1039
-`SCHEDULE`: **@every 168h**: Cron syntax to set how often to check.
1040
1040
-`OLDER_THAN`: **@every 8760h**: any system notice older than this expression will be deleted from database.
1041
1041
1042
+
#### Cron - Garbage collect LFS pointers in repositories ('cron.gc_lfs')
1043
+
1044
+
-`ENABLED`: **false**: Enable service.
1045
+
-`RUN_AT_START`: **false**: Run tasks at start up time (if ENABLED).
1046
+
-`SCHEDULE`: **@every 24h**: Cron syntax to set how often to check.
1047
+
-`OLDER_THAN`: **168h**: Only attempt to garbage collect LFSMetaObjects older than this (default 7 days)
1048
+
-`LAST_UPDATED_MORE_THAN_AGO`: **72h**: Only attempt to garbage collect LFSMetaObjects that have not been attempted to be garbage collected for this long (default 3 days)
1049
+
-`NUMBER_TO_CHECK_PER_REPO`: **100**: Minimum number of stale LFSMetaObjects to check per repo. Set to `0` to always check all.
1050
+
-`PROPORTION_TO_CHECK_PER_REPO`: **0.6**: Check at least this proportion of LFSMetaObjects per repo. (This may cause all stale LFSMetaObjects to be checked.)
1051
+
1042
1052
## Git (`git`)
1043
1053
1044
1054
-`PATH`: **""**: The path of Git executable. If empty, Gitea searches through the PATH environment.
// SELECT `lfs_meta_object`.*, COUNT(`l1`.id) as `count` FROM lfs_meta_object INNER JOIN lfs_meta_object AS l1 ON l1.oid = lfs_meta_object.oid WHERE lfs_meta_object.repository_id = ? GROUP BY lfs_meta_object.id
354
393
sess:=engine.Select("`lfs_meta_object`.*, COUNT(`l1`.oid) AS `count`").
355
394
Join("INNER", "`lfs_meta_object` AS l1", "`lfs_meta_object`.oid = `l1`.oid").
0 commit comments