mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
configurable cleanup
This commit is contained in:
parent
883eb15ecb
commit
ae2abb3cfe
14 changed files with 182 additions and 4 deletions
|
|
@ -202,8 +202,8 @@ export class AssetUploadService extends BaseService {
|
|||
|
||||
@OnJob({ name: JobName.PartialAssetCleanupQueueAll, queue: QueueName.BackgroundTask })
|
||||
async removeStaleUploads(): Promise<void> {
|
||||
// TODO: make this configurable
|
||||
const createdBefore = DateTime.now().minus({ days: 7 }).toJSDate();
|
||||
const config = await this.getConfig({ withCache: false });
|
||||
const createdBefore = DateTime.now().minus({ hours: config.nightlyTasks.removeStaleUploads.hoursAgo }).toJSDate();
|
||||
let jobs: JobItem[] = [];
|
||||
const assets = this.assetJobRepository.streamForPartialAssetCleanupJob(createdBefore);
|
||||
for await (const asset of assets) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue