refs #5598 Push: DB ping interval added
This commit is contained in:
parent
fc68075240
commit
f003fa99de
12
myt-push.js
12
myt-push.js
|
@ -49,6 +49,12 @@ class Push extends Command {
|
|||
const [[row]] = await conn.query(
|
||||
`SELECT GET_LOCK('myt_push', 30) getLock`);
|
||||
|
||||
const pingTimeout = setInterval(async() => {
|
||||
try {
|
||||
await conn.ping()
|
||||
} catch (e) {}
|
||||
}, 60 * 1000);
|
||||
|
||||
if (!row.getLock) {
|
||||
let isUsed = 0;
|
||||
|
||||
|
@ -70,10 +76,10 @@ class Push extends Command {
|
|||
} catch(err) {
|
||||
try {
|
||||
await releaseLock();
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
} catch (e) {}
|
||||
throw err;
|
||||
} finally {
|
||||
clearInterval(pingTimeout);
|
||||
}
|
||||
|
||||
await releaseLock();
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "@verdnatura/myt",
|
||||
"version": "1.5.17",
|
||||
"version": "1.5.18",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@verdnatura/myt",
|
||||
"version": "1.5.17",
|
||||
"version": "1.5.18",
|
||||
"license": "GPL-3.0",
|
||||
"dependencies": {
|
||||
"@sqltools/formatter": "^1.2.5",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@verdnatura/myt",
|
||||
"version": "1.5.17",
|
||||
"version": "1.5.18",
|
||||
"author": "Verdnatura Levante SL",
|
||||
"description": "MySQL version control",
|
||||
"license": "GPL-3.0",
|
||||
|
|
Loading…
Reference in New Issue