Skip to content

Commit 51635b6

Browse files
author
ml9951
committed
Provess checkin updates sequentially.
It seems that firing off 25 database updates simultaneously is exceeding some sort of mlab quota
1 parent ab36e14 commit 51635b6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

backend/feed-proc.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,8 @@ class FeedProc{
148148
return ps[i]().then(() => this.seq(ps, i+1));
149149
}
150150

151+
152+
151153
/**
152154
* Perform a single iteration of fetching data from the API
153155
* @return {void} - data is inserted in the DB
@@ -162,8 +164,7 @@ class FeedProc{
162164
}))
163165
.then(({meta, response}) => {
164166
this.lastID = response.pagination.max_id || this.lastID;
165-
// return this.seq(response.checkins.items.map(c => () => this.processCheckin(c)), 0);
166-
return Promise.all(response.checkins.items.map(this.processCheckin.bind(this)))
167+
return this.seq(response.checkins.items.map(c => () => this.processCheckin(c)), 0);
167168
})
168169
.then(checkins => {
169170
if(checkins.length > 12){

0 commit comments

Comments
 (0)