Skip to content

Commit

Permalink
forgot to add db insert for instagram stream
Browse files Browse the repository at this point in the history
  • Loading branch information
will-horning committed Jul 29, 2014
1 parent 8008118 commit fa639a3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions instagram_stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ var addToQueue = function(db, new_instagram){
queue.find({}, function(err, instagrams){
if(instagrams.length > config.mongo.QUEUE_SIZE){
var sorted_instagrams = _.sortBy(instagrams, function(ig){
return ig.created_time
return ig.created_time;
});
queue.remove(sorted_tweets[0]);
}
})
});
});
};

Expand Down Expand Up @@ -91,6 +91,9 @@ module.exports = function(app, io, db){
return true;
}
});
_.forEach(results, function(result){
addToQueue(result);
});
if(results.length > 0){
io.emit('instagram', results);
}
Expand Down

0 comments on commit fa639a3

Please sign in to comment.