mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-28 19:29:03 +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);
|
||||
|
||||
if (isvld) {
|
||||
for (let i = 0; i < 3; i++) {
|
||||
try {
|
||||
|
||||
core.video(v).then((data) => {
|
||||
const k = data.video;
|
||||
const json = data.json;
|
||||
|
@ -141,16 +140,7 @@ module.exports = function (app, config, renderTemplate) {
|
|||
lyrics: "",
|
||||
});
|
||||
});
|
||||
break;
|
||||
} catch (err) {
|
||||
if (err.status === 503) {
|
||||
// retry after a bit
|
||||
await new Promise((resolve) => setTimeout(resolve, 1000));
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
res.redirect("/");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue