make cached assets ttl set via config

This commit is contained in:
Henry Oswald 2016-05-19 16:51:50 +01:00
parent b65dfb02a4
commit 9ae37d1814
2 changed files with 5 additions and 1 deletions

View file

@ -4,10 +4,11 @@ db = require "./db"
async = require "async"
logger = require "logger-sharelatex"
oneDay = 24 * 60 * 60 * 1000
Settings = require "settings-sharelatex"
module.exports = ProjectPersistenceManager =
EXPIRY_TIMEOUT: oneDay * 2.5
EXPIRY_TIMEOUT: Settings.project_cache_length_ms || oneDay * 2.5
markProjectAsJustAccessed: (project_id, callback = (error) ->) ->
db.Project.findOrCreate(where: {project_id: project_id})
@ -52,3 +53,4 @@ module.exports = ProjectPersistenceManager =
.then((projects) ->
callback null, projects.map((project) -> project.project_id)
).error callback

View file

@ -35,8 +35,10 @@ module.exports =
load_port: 3044
host: "localhost"
apis:
clsi:
url: "http://localhost:3013"
smokeTest: false
project_cache_length_ms: 60 * 60 * 24