2021-01-22 19:41:11 +02:00
|
|
|
import Setting from '../models/Setting';
|
|
|
|
import ItemChange from '../models/ItemChange';
|
2019-01-14 21:11:54 +02:00
|
|
|
|
2021-01-22 19:41:11 +02:00
|
|
|
export default class ItemChangeUtils {
|
2019-01-14 21:11:54 +02:00
|
|
|
static async deleteProcessedChanges() {
|
2021-05-13 18:57:37 +02:00
|
|
|
const lastProcessedChangeIds = [
|
|
|
|
Setting.value('resourceService.lastProcessedChangeId'),
|
|
|
|
Setting.value('searchEngine.lastProcessedChangeId'),
|
|
|
|
Setting.value('revisionService.lastProcessedChangeId'),
|
|
|
|
];
|
2019-01-14 21:11:54 +02:00
|
|
|
|
|
|
|
const lowestChangeId = Math.min(...lastProcessedChangeIds);
|
|
|
|
await ItemChange.deleteOldChanges(lowestChangeId);
|
|
|
|
}
|
|
|
|
}
|