From dfa1db1432d5fd075127cf4aa67003b91aecee45 Mon Sep 17 00:00:00 2001 From: guillermo Date: Tue, 5 Mar 2024 07:44:07 +0100 Subject: [PATCH] feat: refs #5846 Added eventScheduler function --- myt-push.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/myt-push.js b/myt-push.js index 970fc7b..77c3b9c 100644 --- a/myt-push.js +++ b/myt-push.js @@ -225,6 +225,7 @@ class Push extends Command { // Apply versions this.emit('applyingVersions'); + await this.eventScheduler(false); let nVersions = 0; let nChanges = 0; @@ -342,6 +343,7 @@ class Push extends Command { await conn.query('FLUSH PRIVILEGES'); await conn.query(`DROP TEMPORARY TABLE tProcsPriv`); } + await this.eventScheduler(true); } for (const change of changes) @@ -533,6 +535,12 @@ class Push extends Command { return a.path.localeCompare(b.path); }); } + + async eventScheduler(isActive) { + await conn.query( + `SET GLOBAL event_scheduler = ${isActive ? 'ON' : 'OFF'}` + ); + } } const typeMap = {