Added retry for deezer availability check and log error's traceback
This commit is contained in:
parent
d6bf3678f4
commit
312423e2a4
6
server/dist/main.js
vendored
6
server/dist/main.js
vendored
@ -38,10 +38,12 @@ function isDeezerAvailable() {
|
|||||||
let response;
|
let response;
|
||||||
try {
|
try {
|
||||||
response = yield got_1.default.get('https://www.deezer.com/', {
|
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;
|
deezerAvailable = false;
|
||||||
return deezerAvailable;
|
return deezerAvailable;
|
||||||
}
|
}
|
||||||
|
@ -27,9 +27,11 @@ export async function isDeezerAvailable(): Promise<boolean> {
|
|||||||
let response
|
let response
|
||||||
try {
|
try {
|
||||||
response = await got.get('https://www.deezer.com/', {
|
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
|
deezerAvailable = false
|
||||||
return deezerAvailable
|
return deezerAvailable
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user