@verdnatura/myt 1.5.17 → 1.5.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/myt-push.js +9 -3
- package/package.json +1 -1
package/myt-push.js
CHANGED
|
@@ -49,6 +49,12 @@ class Push extends Command {
|
|
|
49
49
|
const [[row]] = await conn.query(
|
|
50
50
|
`SELECT GET_LOCK('myt_push', 30) getLock`);
|
|
51
51
|
|
|
52
|
+
const pingTimeout = setInterval(async() => {
|
|
53
|
+
try {
|
|
54
|
+
await conn.ping()
|
|
55
|
+
} catch (e) {}
|
|
56
|
+
}, 60 * 1000);
|
|
57
|
+
|
|
52
58
|
if (!row.getLock) {
|
|
53
59
|
let isUsed = 0;
|
|
54
60
|
|
|
@@ -70,10 +76,10 @@ class Push extends Command {
|
|
|
70
76
|
} catch(err) {
|
|
71
77
|
try {
|
|
72
78
|
await releaseLock();
|
|
73
|
-
} catch (e) {
|
|
74
|
-
console.error(e);
|
|
75
|
-
}
|
|
79
|
+
} catch (e) {}
|
|
76
80
|
throw err;
|
|
81
|
+
} finally {
|
|
82
|
+
clearInterval(pingTimeout);
|
|
77
83
|
}
|
|
78
84
|
|
|
79
85
|
await releaseLock();
|