Update time references to Eastern Time and adjust maintenance job schedule
Build Images and Deploy / Update-PROD-Stack (push) Successful in 1m28s
Build Images and Deploy / Update-PROD-Stack (push) Successful in 1m28s
This commit is contained in:
@@ -177,7 +177,7 @@ At low activity the curve is approximately linear (≈ $0.25 per post/hr). At hi
|
||||
|
||||
## 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 | 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-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).
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ services:
|
||||
MAX_POSITION_VALUE: "${MAX_POSITION_VALUE:-1000}"
|
||||
FUND_MAX_POSITION_SHARES: "${FUND_MAX_POSITION_SHARES:-1000}"
|
||||
FUND_MAX_POSITION_VALUE: "${FUND_MAX_POSITION_VALUE:-10000}"
|
||||
TZ: "America/Toronto"
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
@@ -43,6 +44,7 @@ services:
|
||||
MASTODON_POST_LIMIT: "${MASTODON_POST_LIMIT:-20}"
|
||||
PRICE_HISTORY_ACTIVE_DAYS: "${PRICE_HISTORY_ACTIVE_DAYS:-7}"
|
||||
PRICE_HISTORY_INACTIVE_HOURS: "${PRICE_HISTORY_INACTIVE_HOURS:-24}"
|
||||
TZ: "America/Toronto"
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
|
||||
@@ -16,9 +16,9 @@ function buildPrizes(): number[] {
|
||||
|
||||
function isSameDay(a: Date, b: Date) {
|
||||
return (
|
||||
a.getUTCFullYear() === b.getUTCFullYear() &&
|
||||
a.getUTCMonth() === b.getUTCMonth() &&
|
||||
a.getUTCDate() === b.getUTCDate()
|
||||
a.getFullYear() === b.getFullYear() &&
|
||||
a.getMonth() === b.getMonth() &&
|
||||
a.getDate() === b.getDate()
|
||||
)
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ function isSameDay(a: Date, b: Date) {
|
||||
* POST /api/lottery/pick
|
||||
* Body: { box: number } (0-indexed, 0–24)
|
||||
*
|
||||
* 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) {
|
||||
const session = await getServerSession(authOptions)
|
||||
|
||||
+2
-2
@@ -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(
|
||||
'daily-maintenance',
|
||||
{},
|
||||
{
|
||||
repeat: { pattern: '0 5 * * *' },
|
||||
repeat: { pattern: '0 0 * * *' },
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user