Added retry for deezer availability check and log error's traceback

This commit is contained in:
RemixDev 2021-07-03 13:03:56 +02:00
parent d6bf3678f4
commit 312423e2a4
2 changed files with 8 additions and 4 deletions

6
server/dist/main.js vendored
View File

@ -38,10 +38,12 @@ function isDeezerAvailable() {
let response;
try {
response = yield got_1.default.get('https://www.deezer.com/', {
headers: { Cookie: 'dz_lang=en; Domain=deezer.com; Path=/; Secure; hostOnly=false;' }
headers: { Cookie: 'dz_lang=en; Domain=deezer.com; Path=/; Secure; hostOnly=false;' },
retry: 5
});
}
catch (_a) {
catch (e) {
console.trace(e);
deezerAvailable = false;
return deezerAvailable;
}

View File

@ -27,9 +27,11 @@ export async function isDeezerAvailable(): Promise<boolean> {
let response
try {
response = await got.get('https://www.deezer.com/', {
headers: { Cookie: 'dz_lang=en; Domain=deezer.com; Path=/; Secure; hostOnly=false;' }
headers: { Cookie: 'dz_lang=en; Domain=deezer.com; Path=/; Secure; hostOnly=false;' },
retry: 5
})
} catch {
} catch (e) {
console.trace(e)
deezerAvailable = false
return deezerAvailable
}