Timeout is buggy

This commit is contained in:
Akif9748 2022-04-06 21:33:16 +03:00
parent eb9833ea3d
commit 55100424be
2 changed files with 4 additions and 6 deletions

View file

@ -17,8 +17,7 @@ app.use(require("../middlewares/login"));
app.post("/", async (req, res) => { app.post("/", async (req, res) => {
if (req.ratelimit) // if (req.ratelimit) return error(res, 429, "Wait until " + new Date(req.timeout.until).toLocaleTimeString("tr") + ", you are too quick for send.")
return error(res, 429, "Wait until " + new Date(req.timeout.until).toLocaleTimeString("tr") + ", you are too quick for send.")
const thread = await new Thread().getById(req.body.threadID); const thread = await new Thread().getById(req.body.threadID);
if (thread) { if (thread) {
@ -27,8 +26,8 @@ app.post("/", async (req, res) => {
thread.push(message.id); thread.push(message.id);
thread.write(); thread.write();
req.timeout.until += 1000 * 30; // req.timeout.until += 1000 * 30;
await req.timeout.save() // await req.timeout.save()
res.redirect('/threads/' + req.body.threadID); res.redirect('/threads/' + req.body.threadID);

View file

@ -50,8 +50,7 @@ app.use(require("../middlewares/login"));
app.post("/", async (req, res) => { app.post("/", async (req, res) => {
if (req.ratelimit) // if (req.ratelimit) return error(res, 429, "Wait until " + new Date(req.timeout.until).toLocaleTimeString("tr") + ", you are too quick for send.")
return error(res, 429, "Wait until " + new Date(req.timeout.until).toLocaleTimeString("tr") + ", you are too quick for send.")
const { title = null, content = null } = req.body; const { title = null, content = null } = req.body;