@verdnatura/myt 1.6.8 → 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.
Files changed (2) hide show
  1. package/myt-push.js +10 -0
  2. 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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@verdnatura/myt",
3
- "version": "1.6.8",
3
+ "version": "1.6.9",
4
4
  "author": "Verdnatura Levante SL",
5
5
  "description": "MySQL version control",
6
6
  "license": "GPL-3.0",