A decentralized music tracking and discovery platform built on AT Protocol 🎵
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: update cron job interval for session refresh from 3 minutes to 1 minute

+2 -6
-4
apps/api/src/db.ts
··· 133 133 db: Database, 134 134 ctx: Context 135 135 ) => { 136 - const inTwoDays = new Date( 137 - Date.now() + 2 * 24 * 60 * 60 * 1000 138 - ).toISOString(); 139 136 const now = new Date().toISOString(); 140 137 141 138 const sessions = await db ··· 143 140 .selectAll() 144 141 .where("expiresAt", "is not", "NULL") 145 142 .where("expiresAt", ">", now) 146 - .where("expiresAt", "<=", inTwoDays) 147 143 .orderBy("expiresAt", "asc") 148 144 .execute(); 149 145
+2 -2
apps/api/src/scripts/exp.ts
··· 9 9 10 10 await refreshSessionsAboutToExpire(db, ctx); 11 11 12 - // run every 3 minutes 13 - cron.schedule("*/3 * * * *", async () => { 12 + // run every 1 minute 13 + cron.schedule("* * * * *", async () => { 14 14 console.log("Running session refresh job..."); 15 15 await refreshSessionsAboutToExpire(db, ctx); 16 16 });