fix epoch

This commit is contained in:
Omer Sabic 2024-06-14 10:45:51 +02:00
parent 7d5326af79
commit e8325bce03

View File

@ -34,7 +34,7 @@ export const webhookRoutes = (fastify, _, done) => {
const [user] = await db.select().from(users).where(eq(users.channel_id, channel));
if(!user) return reply.code(400).send("Invalid user");
await db.update(sites).set({
pubsub_expiry: new Date(new Date().getTime() + parseInt(req.query["hub.lease_seconds"] || 172800))
pubsub_expiry: new Date(new Date().getTime() + parseInt(req.query["hub.lease_seconds"] || 172800 * 1000))
}).where(eq(sites.user_id, user.id));
// Respond with the challenge to verify the subscription
console.log(req.query)