diff options
author | Evgeny Zinoviev <me@ch1p.io> | 2022-03-14 03:04:21 +0300 |
---|---|---|
committer | Evgeny Zinoviev <me@ch1p.io> | 2022-03-14 03:04:21 +0300 |
commit | a20b9c9b075414ea76f32d99e7a99a004f394a31 (patch) | |
tree | c3a24db2c4016070134a662c9b7fcd39fd8213fb | |
parent | b33e6f0abab13b986e167997ed862f78399ee18a (diff) |
maybe another fix
-rw-r--r-- | index.js | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -46,7 +46,7 @@ router.get('/request', async (ctx, next) => { }); }*/ - let myError = false + let responseSet = false await new Promise(async (resolve, reject) => { const page = await browser.getPage( (e) => e.isDownload === true, @@ -87,14 +87,13 @@ router.get('/request', async (ctx, next) => { ctx.status = 500 ctx.body = error + responseSet = true resolve() - } else { - myError = true } } }) - if (!myError) + if (!responseSet) ctx.body = JSON.stringify(myResult) await next() |