Merge pull request #677 from galaxycard/bugfix/clearQueue

Clear old message by datetime, not by timestamp)
This commit is contained in:
Tomas Bures 2019-08-20 14:48:28 +02:00 committed by GitHub
commit ebb6c2ff74
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -592,7 +592,7 @@ async function scheduleQueued() {
const expiredCount = await knex('queued') const expiredCount = await knex('queued')
.whereNotIn('send_configuration', sendConfigurationsIdsInProcessing) .whereNotIn('send_configuration', sendConfigurationsIdsInProcessing)
.where('type', type) .where('type', type)
.where('created', '<', expirationThreshold.threshold) .where('created', '<', new Date(expirationThreshold.threshold))
.del(); .del();
if (expiredCount) { if (expiredCount) {
@ -731,4 +731,3 @@ async function init() {
// noinspection JSIgnoredPromiseFromCall // noinspection JSIgnoredPromiseFromCall
init(); init();