2019-01-14 21:11:54 +02:00
|
|
|
const Setting = require('lib/models/Setting');
|
|
|
|
const ItemChange = require('lib/models/ItemChange');
|
|
|
|
|
|
|
|
class ItemChangeUtils {
|
|
|
|
|
|
|
|
static async deleteProcessedChanges() {
|
|
|
|
const lastProcessedChangeIds = [
|
|
|
|
Setting.value('resourceService.lastProcessedChangeId'),
|
|
|
|
Setting.value('searchEngine.lastProcessedChangeId'),
|
2019-05-06 22:35:29 +02:00
|
|
|
Setting.value('revisionService.lastProcessedChangeId'),
|
2019-01-14 21:11:54 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
const lowestChangeId = Math.min(...lastProcessedChangeIds);
|
|
|
|
await ItemChange.deleteOldChanges(lowestChangeId);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = ItemChangeUtils;
|