1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-09 08:45:55 +02:00
joplin/packages/lib/services/ItemChangeUtils.js
2020-11-05 16:58:23 +00:00

14 lines
528 B
JavaScript

const Setting = require('../models/Setting').default;
const ItemChange = require('../models/ItemChange');
class ItemChangeUtils {
static async deleteProcessedChanges() {
const lastProcessedChangeIds = [Setting.value('resourceService.lastProcessedChangeId'), Setting.value('searchEngine.lastProcessedChangeId'), Setting.value('revisionService.lastProcessedChangeId')];
const lowestChangeId = Math.min(...lastProcessedChangeIds);
await ItemChange.deleteOldChanges(lowestChangeId);
}
}
module.exports = ItemChangeUtils;