mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-10 16:08:25 +01:00
faster fetching :3
This commit is contained in:
parent
44a938852d
commit
4d87c3621d
1 changed files with 2 additions and 12 deletions
|
@ -81,8 +81,7 @@ module.exports = function (app, config, renderTemplate) {
|
||||||
const isvld = await core.isvalidvideo(v);
|
const isvld = await core.isvalidvideo(v);
|
||||||
|
|
||||||
if (isvld) {
|
if (isvld) {
|
||||||
for (let i = 0; i < 3; i++) {
|
|
||||||
try {
|
|
||||||
core.video(v).then((data) => {
|
core.video(v).then((data) => {
|
||||||
const k = data.video;
|
const k = data.video;
|
||||||
const json = data.json;
|
const json = data.json;
|
||||||
|
@ -141,16 +140,7 @@ module.exports = function (app, config, renderTemplate) {
|
||||||
lyrics: "",
|
lyrics: "",
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
break;
|
|
||||||
} catch (err) {
|
|
||||||
if (err.status === 503) {
|
|
||||||
// retry after a bit
|
|
||||||
await new Promise((resolve) => setTimeout(resolve, 1000));
|
|
||||||
} else {
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
res.redirect("/");
|
res.redirect("/");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue