Merge pull request #77 from MD1125/main

Add Mines Gambling Game to Rugplay
This commit is contained in:
Face 2025-06-24 13:10:47 +03:00 committed by GitHub
commit 05b44be32e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 1563 additions and 12 deletions

View file

@ -7,6 +7,7 @@ import { redirect, type Handle } from '@sveltejs/kit';
import { db } from '$lib/server/db';
import { user } from '$lib/server/db/schema';
import { eq } from 'drizzle-orm';
import { minesCleanupInactiveGames, minesAutoCashout } from '$lib/server/games/mines';
async function initializeScheduler() {
if (building) return;
@ -49,10 +50,16 @@ async function initializeScheduler() {
processAccountDeletions().catch(console.error);
}, 5 * 60 * 1000);
const minesCleanupInterval = setInterval(() => {
minesCleanupInactiveGames().catch(console.error);
minesAutoCashout().catch(console.error);
}, 60 * 1000);
// Cleanup on process exit
const cleanup = async () => {
clearInterval(renewInterval);
clearInterval(schedulerInterval);
clearInterval(minesCleanupInterval);
const currentValue = await redis.get(lockKey);
if (currentValue === lockValue) {
await redis.del(lockKey);