change game list threshold from two weeks to 90 days

This commit is contained in:
Jesse D. McDonald 2020-07-16 15:44:49 -05:00
parent 6a1a709f8b
commit e21541d0af
1 changed files with 2 additions and 2 deletions

View File

@ -163,12 +163,12 @@ async function getGameListHandler(req, res) {
/* Save the async promise _before_ the query so we don't miss any updates while suspended. */
const gameUpdate = waitForAnyGameUpdate().then(() => 'update');
const cutoff = (+new Date()) - (2 * 7 * 24 * 3600 * 1000); /* 2 weeks ago */
const cutoff = (+new Date()) - (90 * 24 * 3600 * 1000); /* 90 days ago */
const whereClause = (afterTime === undefined) ? `true` : `modified > $afterTime`;
const querySql = `
SELECT gameId, lightName, darkName, moves, status, timestamp, modified
FROM games WHERE timestamp >= $cutoff AND ${whereClause} ORDER BY timestamp DESC
LIMIT 1000
LIMIT 200
`;
const results = await (await dbInit).allAsync(querySql, {
$afterTime: afterTime,