refactor(core): Move more typeorm operators to repositories (no-changelog) (#8143)

Follow-up to #8139
This commit is contained in:
Iván Ovejero
2023-12-22 16:20:30 +01:00
committed by GitHub
parent 4007163651
commit a59d78de18
11 changed files with 81 additions and 55 deletions

View File

@@ -1,5 +1,4 @@
import { Service } from 'typedi';
import { LessThan } from 'typeorm';
import { DateTime } from 'luxon';
import { WorkflowHistoryRepository } from '@db/repositories/workflowHistory.repository';
import { WORKFLOW_HISTORY_PRUNE_INTERVAL } from './constants';
@@ -38,8 +37,6 @@ export class WorkflowHistoryManager {
}
const pruneDateTime = DateTime.now().minus({ hours: pruneHours }).toJSDate();
await this.workflowHistoryRepo.delete({
createdAt: LessThan(pruneDateTime),
});
await this.workflowHistoryRepo.deleteEarlierThan(pruneDateTime);
}
}