mirror of
https://github.com/Akif9748/akf-forum.git
synced 2024-11-26 05:10:41 +03:00
Timeout is buggy
This commit is contained in:
parent
eb9833ea3d
commit
55100424be
2 changed files with 4 additions and 6 deletions
|
@ -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);
|
||||||
|
|
||||||
|
|
|
@ -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;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue