Update time references to Eastern Time and adjust maintenance job schedule
Build Images and Deploy / Update-PROD-Stack (push) Successful in 1m28s

This commit is contained in:
2026-03-27 22:01:53 -04:00
parent f4c379b0d4
commit 9e93c3db57
4 changed files with 10 additions and 8 deletions
+2 -2
View File
@@ -177,7 +177,7 @@ At low activity the curve is approximately linear (≈ $0.25 per post/hr). At hi
## Research System ## Research System
- Every player earns **1 research point per day** (awarded at 00:05 UTC by the maintenance worker). - Every player earns **1 research point per day** (awarded at midnight EST by the maintenance worker).
- Balance milestones unlock extra daily points: - Balance milestones unlock extra daily points:
| Balance | Daily points | | Balance | Daily points |
@@ -222,7 +222,7 @@ Three BullMQ queues:
|---|---| |---|---|
| `hashex-price-updates` | One job per active hashtag; fetches Mastodon and updates price + price history. Concurrency = 1 to respect rate limits. | | `hashex-price-updates` | One job per active hashtag; fetches Mastodon and updates price + price history. Concurrency = 1 to respect rate limits. |
| `hashex-scheduler` | Fires every `PRICE_UPDATE_INTERVAL_MINUTES`. Enqueues price-update jobs ordered by `lastUpdated ASC` (most stale first). Deduplicates by `jobId` to avoid pile-up. | | `hashex-scheduler` | Fires every `PRICE_UPDATE_INTERVAL_MINUTES`. Enqueues price-update jobs ordered by `lastUpdated ASC` (most stale first). Deduplicates by `jobId` to avoid pile-up. |
| `hashex-maintenance` | Runs daily at 00:05 UTC. Awards research points based on each player's balance. | | `hashex-maintenance` | Runs daily at midnight EST. Awards research points based on each player's balance. |
The worker retries failed jobs up to 3 times with exponential back-off (5 s base delay). The worker retries failed jobs up to 3 times with exponential back-off (5 s base delay).
+2
View File
@@ -20,6 +20,7 @@ services:
MAX_POSITION_VALUE: "${MAX_POSITION_VALUE:-1000}" MAX_POSITION_VALUE: "${MAX_POSITION_VALUE:-1000}"
FUND_MAX_POSITION_SHARES: "${FUND_MAX_POSITION_SHARES:-1000}" FUND_MAX_POSITION_SHARES: "${FUND_MAX_POSITION_SHARES:-1000}"
FUND_MAX_POSITION_VALUE: "${FUND_MAX_POSITION_VALUE:-10000}" FUND_MAX_POSITION_VALUE: "${FUND_MAX_POSITION_VALUE:-10000}"
TZ: "America/Toronto"
depends_on: depends_on:
postgres: postgres:
condition: service_healthy condition: service_healthy
@@ -43,6 +44,7 @@ services:
MASTODON_POST_LIMIT: "${MASTODON_POST_LIMIT:-20}" MASTODON_POST_LIMIT: "${MASTODON_POST_LIMIT:-20}"
PRICE_HISTORY_ACTIVE_DAYS: "${PRICE_HISTORY_ACTIVE_DAYS:-7}" PRICE_HISTORY_ACTIVE_DAYS: "${PRICE_HISTORY_ACTIVE_DAYS:-7}"
PRICE_HISTORY_INACTIVE_HOURS: "${PRICE_HISTORY_INACTIVE_HOURS:-24}" PRICE_HISTORY_INACTIVE_HOURS: "${PRICE_HISTORY_INACTIVE_HOURS:-24}"
TZ: "America/Toronto"
depends_on: depends_on:
postgres: postgres:
condition: service_healthy condition: service_healthy
+4 -4
View File
@@ -16,9 +16,9 @@ function buildPrizes(): number[] {
function isSameDay(a: Date, b: Date) { function isSameDay(a: Date, b: Date) {
return ( return (
a.getUTCFullYear() === b.getUTCFullYear() && a.getFullYear() === b.getFullYear() &&
a.getUTCMonth() === b.getUTCMonth() && a.getMonth() === b.getMonth() &&
a.getUTCDate() === b.getUTCDate() a.getDate() === b.getDate()
) )
} }
@@ -26,7 +26,7 @@ function isSameDay(a: Date, b: Date) {
* POST /api/lottery/pick * POST /api/lottery/pick
* Body: { box: number } (0-indexed, 024) * Body: { box: number } (0-indexed, 024)
* *
* One free play per calendar day (UTC). Reveals prize at the chosen box. * One free play per calendar day (Eastern Time). Reveals prize at the chosen box.
*/ */
export async function POST(req: NextRequest) { export async function POST(req: NextRequest) {
const session = await getServerSession(authOptions) const session = await getServerSession(authOptions)
+2 -2
View File
@@ -502,12 +502,12 @@ async function setupRepeatableJobs() {
}, },
) )
// Daily maintenance — every day at 05:00 UTC // Daily maintenance — every day at 00:00 Eastern (midnight)
await maintenanceQueue.add( await maintenanceQueue.add(
'daily-maintenance', 'daily-maintenance',
{}, {},
{ {
repeat: { pattern: '0 5 * * *' }, repeat: { pattern: '0 0 * * *' },
}, },
) )