From 7e428f976f22c313ba0adae17f77bae9fcd9d121 Mon Sep 17 00:00:00 2001 From: xangelo Date: Fri, 26 Jan 2024 16:22:17 -0500 Subject: [PATCH] force a default of 6 hours of articles on a fresh load --- src/server.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/server.ts b/src/server.ts index 0c93175..579f3ee 100644 --- a/src/server.ts +++ b/src/server.ts @@ -99,7 +99,8 @@ app.get('/river', async (req, res) => { const displayedItems = req.header('entry-count'); let firstLoad = true; - let createdAt = Math.floor(Date.now()/1000 - (60 * 60)); + const freshReadInHours = parseInt(process.env.FRESH_READ_IN_HOURS) || 6; + let createdAt = Math.floor(Date.now()/1000 - ((60 * 60) * freshReadInHours)); if(!displayedItems) { const temp = parseInt(header); -- 2.25.1