diff --git a/src/generator/Generator.ts b/src/generator/Generator.ts index 10b59bf4..b2d5246e 100644 --- a/src/generator/Generator.ts +++ b/src/generator/Generator.ts @@ -1498,7 +1498,7 @@ export class SavedSkin { const info = await this.skin.toResponseJson(); info.duplicate = this.duplicate; if (delayInfo) { - info.nextRequest = delayInfo.seconds; // deprecated + info.nextRequest = Math.round(delayInfo.seconds); // deprecated info.delayInfo = { millis: delayInfo.millis, diff --git a/src/index.ts b/src/index.ts index 66b7f59f..2005c082 100644 --- a/src/index.ts +++ b/src/index.ts @@ -12,7 +12,17 @@ import morgan from "morgan"; import * as bodyParser from "body-parser"; import fileUpload from "express-fileupload"; import cookieParser from "cookie-parser"; -import { accountManagerRoute, accountRoute, apiKeyRoute, generateRoute, getRoute, hiatusRoute, renderRoute, testerRoute, utilRoute } from "./routes"; +import { + accountManagerRoute, + accountRoute, + apiKeyRoute, + generateRoute, + getRoute, + hiatusRoute, + renderRoute, + testerRoute, + utilRoute +} from "./routes"; import { MOJ_DIR, UPL_DIR, URL_DIR } from "./generator/Temp"; import { getConfig, getLocalConfig, MineSkinConfig } from "./typings/Configs"; import { isBreadRequest, MineSkinError } from "./typings"; @@ -302,7 +312,7 @@ async function init() { errorType: err.name, errorCode: err.code, error: err.msg, - nextRequest: (Date.now() / 1000) + delayInfo.seconds, // deprecated + nextRequest: Math.round((Date.now() / 1000) + delayInfo.seconds), // deprecated delayInfo: { seconds: delayInfo.seconds, diff --git a/src/util/index.ts b/src/util/index.ts index e2889361..49d96f0e 100644 --- a/src/util/index.ts +++ b/src/util/index.ts @@ -54,7 +54,7 @@ export async function checkTraffic(req: Request, res: Response): Promise time - delayInfo.millis) { res.status(429).json({ error: "Too many requests", - nextRequest: (time / 1000) + delayInfo.seconds + 5, // deprecated + nextRequest: Math.round((time / 1000) + delayInfo.seconds + 5), // deprecated delay: delayInfo.seconds, // deprecated delayInfo: {