mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-24 10:27:10 +02:00
14 lines
522 B
JavaScript
14 lines
522 B
JavaScript
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'), Setting.value('revisionService.lastProcessedChangeId')];
|
|
|
|
const lowestChangeId = Math.min(...lastProcessedChangeIds);
|
|
await ItemChange.deleteOldChanges(lowestChangeId);
|
|
}
|
|
}
|
|
|
|
module.exports = ItemChangeUtils;
|