-
Notifications
You must be signed in to change notification settings - Fork 37
Open
Description
Use of global.sequelize and of $lte operator.
I use this patch (with patch-package)
diff --git a/node_modules/koa2-ratelimit/src/SequelizeStore.js b/node_modules/koa2-ratelimit/src/SequelizeStore.js
index f5bceb4..ac3b23b 100644
--- a/node_modules/koa2-ratelimit/src/SequelizeStore.js
+++ b/node_modules/koa2-ratelimit/src/SequelizeStore.js
@@ -1,4 +1,5 @@
const Sequelize = require('sequelize');
+const Op = Sequelize.Op;
const Store = require('./Store.js');
@@ -116,7 +117,7 @@ class SequelizeStore extends Store {
}
async _increment(table, where, nb = 1, field) {
- return table.update({ [field]: global.sequelize.literal(`${field} + ${nb}`) }, { where });
+ return table.update({ [field]: this.sequelize.literal(`${field} + ${nb}`) }, { where });
}
// remove all if time is passed
@@ -124,7 +125,7 @@ class SequelizeStore extends Store {
const now = new Date();
await table.destroy({
where: {
- date_end: { $lte: now.getTime() },
+ date_end: { [Op.lte]: now.getTime() },
},
});
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels