diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2017-07-17 20:25:49 +0200 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2017-07-17 20:25:49 +0200 |
| commit | 8aaa2253547b320471c1d4e37b90cab93917255b (patch) | |
| tree | f40f4f6dcb78029afa01c873e419bc59c35a67e3 | |
| parent | dd6c4c39440982e2943906f2fa30dbbb8260540b (diff) | |
| download | bridge-8aaa2253547b320471c1d4e37b90cab93917255b.tar.gz bridge-8aaa2253547b320471c1d4e37b90cab93917255b.zip | |
fix region update referring to wrong db var
| -rw-r--r-- | service_grab.js | 11 |
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"); |
