feat: refs #5846 Added eventScheduler function #4
|
@ -133,6 +133,9 @@ class Push extends Command {
|
|||
if (opts.remote == 'local')
|
||||
opts.commit = true;
|
||||
|
||||
const [[scheduler]] = await conn.query(`SELECT @@event_scheduler state`);
|
||||
if (scheduler.state === 'ON') await eventScheduler(false);
|
||||
guillermo marked this conversation as resolved
Outdated
|
||||
|
||||
// Obtain exclusive lock
|
||||
|
||||
const [[row]] = await conn.query(
|
||||
|
@ -153,6 +156,7 @@ class Push extends Command {
|
|||
isUsed = row.isUsed;
|
||||
}
|
||||
|
||||
if (scheduler.state === 'ON') await eventScheduler(false);
|
||||
throw new Error(`Cannot obtain exclusive lock, used by connection ${isUsed}`);
|
||||
}
|
||||
|
||||
|
@ -164,11 +168,10 @@ class Push extends Command {
|
|||
|
||||
async function releaseLock() {
|
||||
await conn.query(`DO RELEASE_LOCK('myt_push')`);
|
||||
await eventScheduler(true);
|
||||
if (scheduler.state === 'ON') await eventScheduler(true);
|
||||
guillermo marked this conversation as resolved
Outdated
juan
commented
Mover antes del RELEASE_LOCK Mover antes del RELEASE_LOCK
|
||||
}
|
||||
|
||||
try {
|
||||
await eventScheduler(false);
|
||||
await this.push(myt, opts, conn);
|
||||
} catch(err) {
|
||||
try {
|
||||
|
|
Loading…
Reference in New Issue
Mover a despues del GET_LOCK