From e21541d0afcb0064959a56461372f01003c1c41f Mon Sep 17 00:00:00 2001 From: Jesse McDonald Date: Thu, 16 Jul 2020 15:44:49 -0500 Subject: [PATCH] change game list threshold from two weeks to 90 days --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 5c49524..5b8590f 100644 --- a/index.js +++ b/index.js @@ -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,