mirror of
https://github.com/Xevion/bus-reminder.git
synced 2025-12-15 16:11:16 -06:00
15 lines
363 B
TypeScript
15 lines
363 B
TypeScript
import { Redis } from 'ioredis';
|
|
import { env } from '@/env/server.mjs';
|
|
import { format } from 'date-fns';
|
|
|
|
console.log(env.REDIS_URL);
|
|
const redis = new Redis(env.REDIS_URL, { maxRetriesPerRequest: 2 });
|
|
|
|
export async function test() {
|
|
const now = new Date();
|
|
const key = format(now, 'yyyy-MM-dd');
|
|
|
|
const current = await redis.incr(key);
|
|
return current;
|
|
}
|