From 77e1dc173337ba051991bc0af276685851d8ca79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20Po=C5=BEega?= Date: Thu, 9 Nov 2023 15:02:59 +0100 Subject: [PATCH] Update index creation in order to match new sort query https://github.com/agenda/agendash/issues/241 --- lib/controllers/agendash.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/controllers/agendash.js b/lib/controllers/agendash.js index ef770e8a..ecfdc2c3 100644 --- a/lib/controllers/agendash.js +++ b/lib/controllers/agendash.js @@ -9,7 +9,7 @@ module.exports = function (agenda, options) { const collection = agenda._collection.collection || agenda._collection; collection.createIndexes( [ - { key: { nextRunAt: -1, lastRunAt: -1, lastFinishedAt: -1 } }, + { key: { repeatInterval: -1, nextRunAt: -1, lastRunAt: -1, lastFinishedAt: -1 } }, { key: { name: 1, nextRunAt: -1, lastRunAt: -1, lastFinishedAt: -1 } }, ], (error) => {