summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--service_grab.js11
1 files changed, 6 insertions, 5 deletions
diff --git a/service_grab.js b/service_grab.js
index 96770ce..2ce1572 100644
--- a/service_grab.js
+++ b/service_grab.js
@@ -281,11 +281,12 @@ module.exports = class Analyzer extends Service {
// update a region from API based on db records
async updateRegion(region, category) {
let grabstart;
- const last_match = await this.getDatabase(category).Participant.findOne({
- attributes: ["created_at"],
- where: { shard_id: region },
- order: [ [seq.col("created_at"), "DESC"] ]
- });
+ const db = this.getDatabase(category),
+ last_match = await db.Participant.findOne({
+ attributes: ["created_at"],
+ where: { shard_id: region },
+ order: [ [db.col("created_at"), "DESC"] ]
+ });
if (last_match == null) grabstart = undefined;
else grabstart = last_match.get("created_at");