mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
recent notes are kept only for one day
This commit is contained in:
parent
14001f67d8
commit
e47027cbef
@ -49,13 +49,13 @@ async function getRecentNotes() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function deleteOld() {
|
async function deleteOld() {
|
||||||
const cutoffDateAccessed = await sql.getSingleValue("SELECT date_accessed FROM recent_notes WHERE is_deleted = 0 ORDER BY date_accessed DESC LIMIT 100, 1");
|
const cutoffDateAccessed = utils.nowTimestamp() - 24 * 60 * 60;
|
||||||
|
|
||||||
if (cutoffDateAccessed) {
|
|
||||||
await sql.doInTransaction(async () => {
|
await sql.doInTransaction(async () => {
|
||||||
await sql.execute("DELETE FROM recent_notes WHERE date_accessed < ?", [cutoffDateAccessed]);
|
await sql.execute("DELETE FROM recent_notes WHERE date_accessed < ?", [cutoffDateAccessed]);
|
||||||
|
|
||||||
|
await sql.execute("DELETE FROM sync WHERE entity_name = 'recent_notes' AND sync_date < ?", [cutoffDateAccessed]);
|
||||||
});
|
});
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = router;
|
module.exports = router;
|
@ -1 +1 @@
|
|||||||
module.exports = { build_date:"2017-11-26T23:24:39-05:00", build_revision: "1231e02449c08f8f794277e6de7fd401535aa57d" };
|
module.exports = { build_date:"2017-11-28T22:01:30-05:00", build_revision: "14001f67d87a7c7d900088807337fcda0d2fb9a0" };
|
||||||
|
Loading…
x
Reference in New Issue
Block a user