mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
only check packs for archiving once each week
This commit is contained in:
parent
c6e83c6cb8
commit
cac7556ad5
1 changed files with 3 additions and 1 deletions
|
@ -116,11 +116,13 @@ if pending?
|
||||||
logger.log "got #{pending.length} entries from #{source}"
|
logger.log "got #{pending.length} entries from #{source}"
|
||||||
processUpdates pending
|
processUpdates pending
|
||||||
else
|
else
|
||||||
|
oneWeekAgo = new Date(Date.now() - 7 * DAYS)
|
||||||
db.docHistory.find({
|
db.docHistory.find({
|
||||||
expiresAt: {$exists: false}
|
expiresAt: {$exists: false}
|
||||||
project_id: {$exists: true}
|
project_id: {$exists: true}
|
||||||
v_end: {$exists: true}
|
v_end: {$exists: true}
|
||||||
_id: {$lt: ObjectIdFromDate(new Date(Date.now() - 7 * DAYS))}
|
_id: {$lt: ObjectIdFromDate(oneWeekAgo)}
|
||||||
|
last_checked: {$lt: oneWeekAgo}
|
||||||
}, {_id:1, doc_id:1, project_id:1}).sort({
|
}, {_id:1, doc_id:1, project_id:1}).sort({
|
||||||
last_checked:1
|
last_checked:1
|
||||||
}).limit LIMIT, (err, results) ->
|
}).limit LIMIT, (err, results) ->
|
||||||
|
|
Loading…
Reference in a new issue