mirror of
https://github.com/zadam/trilium.git
synced 2025-11-03 03:46:37 +01:00
don't sync recent_notes
This commit is contained in:
@@ -1,12 +1,21 @@
|
||||
"use strict";
|
||||
|
||||
const RecentNote = require('../../entities/recent_note');
|
||||
const sql = require('../../services/sql');
|
||||
const dateUtils = require('../../services/date_utils');
|
||||
|
||||
function addRecentNote(req) {
|
||||
new RecentNote({
|
||||
noteId: req.body.noteId,
|
||||
notePath: req.body.notePath
|
||||
}).save();
|
||||
|
||||
if (Math.random() < 0.05) {
|
||||
// it's not necessary to run this everytime ...
|
||||
const cutOffDate = dateUtils.utcDateStr(new Date(Date.now() - 24 * 3600 * 1000));
|
||||
|
||||
sql.execute(`DELETE FROM recent_notes WHERE utcDateCreated < ?`, [cutOffDate]);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
|
||||
Reference in New Issue
Block a user