mirror of
https://github.com/RayLabsHQ/gitea-mirror.git
synced 2025-12-11 22:16:44 +03:00
cleanup: improve orphaned repo handling
This commit is contained in:
@@ -100,6 +100,13 @@ export async function createDefaultConfig({ userId, envOverrides = {} }: Default
|
||||
cleanupConfig: {
|
||||
enabled: cleanupEnabled,
|
||||
retentionDays: cleanupRetentionDays,
|
||||
deleteFromGitea: false,
|
||||
deleteIfNotInGitHub: true,
|
||||
protectedRepos: [],
|
||||
dryRun: false,
|
||||
orphanedRepoAction: "archive",
|
||||
batchSize: 10,
|
||||
pauseBetweenDeletes: 2000,
|
||||
lastRun: null,
|
||||
nextRun: cleanupEnabled ? new Date(Date.now() + getCleanupInterval(cleanupRetentionDays) * 1000) : null,
|
||||
},
|
||||
@@ -123,4 +130,4 @@ function getCleanupInterval(retentionSeconds: number): number {
|
||||
if (days <= 7) return 86400; // 24 hours
|
||||
if (days <= 30) return 172800; // 48 hours
|
||||
return 604800; // 1 week
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user