refactor(core): Make executions pruning more resilient (#7480)

This PR converts the hard-deletion interval to a timeout:
- to prevent the interval from not being restored when hard deletion
throws, and
- to prevent a long-running hard deletion from leading to duplicate
deletions.
This commit is contained in:
Iván Ovejero
2023-10-24 16:16:45 +02:00
committed by GitHub
parent 05e6f2a6ac
commit 671c95760b
2 changed files with 47 additions and 53 deletions

View File

@@ -9,7 +9,7 @@ import type { ExecutionRepository } from '../../../src/databases/repositories';
import type { ExecutionEntity } from '../../../src/databases/entities/ExecutionEntity';
import { TIME } from '../../../src/constants';
describe('ExecutionRepository.prune()', () => {
describe('softDeleteOnPruningCycle()', () => {
const now = new Date();
const yesterday = new Date(Date.now() - TIME.DAY);
let executionRepository: ExecutionRepository;