@verdnatura/myt 1.6.7 → 1.6.9
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 +16 -4
- package/package.json +1 -1
package/myt-push.js
CHANGED
|
@@ -156,7 +156,17 @@ class Push extends Command {
|
|
|
156
156
|
throw new Error(`Cannot obtain exclusive lock, used by connection ${isUsed}`);
|
|
157
157
|
}
|
|
158
158
|
|
|
159
|
+
const [[scheduler]] = await conn.query(`SELECT @@event_scheduler state`);
|
|
160
|
+
if (scheduler.state === 'ON') await eventScheduler(false);
|
|
161
|
+
|
|
162
|
+
async function eventScheduler(isActive) {
|
|
163
|
+
await conn.query(
|
|
164
|
+
`SET GLOBAL event_scheduler = ${isActive ? 'ON' : 'OFF'}`
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
|
|
159
168
|
async function releaseLock() {
|
|
169
|
+
if (scheduler.state === 'ON') await eventScheduler(true);
|
|
160
170
|
await conn.query(`DO RELEASE_LOCK('myt_push')`);
|
|
161
171
|
}
|
|
162
172
|
|
|
@@ -244,13 +254,15 @@ class Push extends Command {
|
|
|
244
254
|
|
|
245
255
|
let apply = false;
|
|
246
256
|
|
|
247
|
-
if (!version)
|
|
257
|
+
if (!version) {
|
|
248
258
|
this.emit('version', version, versionDir, 'wrongDirectory');
|
|
249
|
-
|
|
259
|
+
continue;
|
|
260
|
+
} else if (version.number.length != dbVersion.number.length) {
|
|
250
261
|
this.emit('version', version, versionDir, 'badVersion');
|
|
251
|
-
|
|
252
|
-
|
|
262
|
+
continue;
|
|
263
|
+
}
|
|
253
264
|
|
|
265
|
+
apply = version.apply;
|
|
254
266
|
if (apply) showLog = true;
|
|
255
267
|
if (showLog) this.emit('version', version, versionDir);
|
|
256
268
|
if (!apply) continue;
|