fix expired projects command

This commit is contained in:
Henry Oswald committed 2018-07-30 17:37:30 +01:00
1 parent 3a9206f1e7
commit ee518c1755
5 files changed
+11 -5

No files matched your search

+1 -1
View File
@@ -1,7 +1,7 @@
# This file was auto-generated, do not edit it directly.
# Instead run bin/update_build_scripts from
# https://github.com/sharelatex/sharelatex-dev-environment
# Version: 1.1.8
# Version: 1.1.9
BUILD_NUMBER ?= local
BRANCH_NAME ?= $(shell git rev-parse --abbrev-ref HEAD)
+6 -2
View File
@@ -68,11 +68,15 @@ module.exports = ProjectPersistenceManager =
_findExpiredProjectIds: (callback = (error, project_ids) ->) ->
job = (cb)->
console.log("_findExpiredProjectIds")
db.Project.findAll(where: ["lastAccessed < ?", new Date(Date.now() - ProjectPersistenceManager.EXPIRY_TIMEOUT)])
keepProjectsFrom = new Date(Date.now() - ProjectPersistenceManager.EXPIRY_TIMEOUT)
console.log("_findExpiredProjectIds", keepProjectsFrom)
q = {}
q[db.op.gt] = keepProjectsFrom
db.Project.findAll(where:{lastAccessed:q})
.then((projects) ->
cb null, projects.map((project) -> project.project_id)
).error cb
dbQueue.queue.push(job, callback)
+2
View File
@@ -41,6 +41,8 @@ module.exports =
]
})
op: Sequelize.Op
sync: () ->
logger.log dbPath:Settings.mysql.clsi.storage, "syncing db schema"
sequelize.sync()
+1 -1
View File
@@ -1,7 +1,7 @@
# This file was auto-generated, do not edit it directly.
# Instead run bin/update_build_scripts from
# https://github.com/sharelatex/sharelatex-dev-environment
# Version: 1.1.8
# Version: 1.1.9
version: "2"
+1 -1
View File
@@ -1,7 +1,7 @@
# This file was auto-generated, do not edit it directly.
# Instead run bin/update_build_scripts from
# https://github.com/sharelatex/sharelatex-dev-environment
# Version: 1.1.8
# Version: 1.1.9
version: "2"