Wait faster lol
This commit is contained in:
parent
c53f669aad
commit
a6d2990e7a
1 changed files with 2 additions and 2 deletions
4
index.js
4
index.js
|
@ -23,7 +23,7 @@ app.get("/cached/*", (req, res) => {
|
|||
var imgWait = 0
|
||||
function waitForImage() {
|
||||
if (imgWait < imgWaitMax) {
|
||||
imgWait += 0.5
|
||||
imgWait += 0.1
|
||||
setTimeout(() => {
|
||||
imgData = cachedImages[imgURL]
|
||||
if (imgData) {
|
||||
|
@ -31,7 +31,7 @@ app.get("/cached/*", (req, res) => {
|
|||
} else {
|
||||
waitForImage()
|
||||
}
|
||||
}, 500);
|
||||
}, 100);
|
||||
} else {
|
||||
fs.createReadStream(path.join(__dirname, "/imgs/notFound.png")).pipe(res)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue