From 2251cabe865d312a3bc38ee3d62da7cf56a71b03 Mon Sep 17 00:00:00 2001 From: Dragory Date: Sun, 11 Mar 2018 23:19:45 +0200 Subject: [PATCH] Additional fix for scheduling in MySQL/MariaDB --- src/data/Thread.js | 2 +- src/main.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/data/Thread.js b/src/data/Thread.js index 92ffc49..5df777e 100644 --- a/src/data/Thread.js +++ b/src/data/Thread.js @@ -143,7 +143,7 @@ class Thread { dm_message_id: msg.id }); - // The 1970 check is a knex bug, see https://github.com/tgriesser/knex/issues/1276 + // The string type check is due to a knex bug, see https://github.com/tgriesser/knex/issues/1276 if (this.scheduled_close_at && typeof this.scheduled_close_at === 'string') { await this.cancelScheduledClose(); await this.postSystemMessage({ diff --git a/src/main.js b/src/main.js index 0fbcc99..099e196 100644 --- a/src/main.js +++ b/src/main.js @@ -256,7 +256,8 @@ addInboxServerCommand('close', async (msg, args, thread) => { if (args.length) { if (args[0] === 'cancel') { // Cancel timed close - if (thread.scheduled_close_at) { + // The string type check is due to a knex bug, see https://github.com/tgriesser/knex/issues/1276 + if (thread.scheduled_close_at && typeof thread.scheduled_close_at === 'string') { await thread.cancelScheduledClose(); thread.postSystemMessage(`Cancelled scheduled closing`); }