Mercurial > pumpbridge
changeset 25:723eaf36902c
google probs
author | Mathias Gebbe <mgebbe@intevation.de> |
---|---|
date | Mon, 23 Jun 2014 10:56:29 +0200 |
parents | 08d9679da0f7 |
children | cdbc77880565 |
files | src/google.coffee |
diffstat | 1 files changed, 9 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/src/google.coffee Thu Jun 19 13:01:11 2014 +0200 +++ b/src/google.coffee Mon Jun 23 10:56:29 2014 +0200 @@ -43,8 +43,7 @@ #getUser(user) getFriends(user,callback) ], (err, friends) -> - # für jeden Freunde tue dies: hier bewusst von async.eachSeries friends, ((friend, callback) -> auf async.each gewechselt - async.eachLimit friends, 10, ((friend, callback) -> + async.eachLimit friends, 3, ((friend, callb) -> async.waterfall [ (callback) -> getStream(user, friend, callback) @@ -53,6 +52,7 @@ async.eachLimit stream.items, 10, ((post, cb) -> async.waterfall [ (callback) -> + console.log "check googlepost "+ post.id FromESN.search {uid: post.id + "@google_to_" + me}, callback (result, callback) -> return if result.length isnt 0 @@ -63,6 +63,7 @@ else return (parsed, callback) -> + console.log "post googlepost "+ post.id Pump.postUser bridgeid, me, parsed, callback (pumppost, callback) -> pumppost = JSON.parse(pumppost) @@ -76,20 +77,19 @@ , callback ], (err, result) -> #console.log err - #console.log result + console.log "done" cb() return ), (err) -> - callback null, 'done' + callb() + return ], (err, result) -> - #console.log 'done.' - callback null, 'done' ), (err) -> if err console.log 'one post fail to process' else console.log 'all google friends processed' - return + return return @@ -154,7 +154,7 @@ callback null,users (users, callback) -> #EdgeControl.removeEdges(me,'@google') - async.eachLimit 10, users.items, ((user,cb) -> + async.each users.items, ((user,cb) -> if user.id? friends.push(user.id) #Routes.updateUserDB(user.id+'@google',user.displayName,user.displayName,user.url,user.image.url) @@ -201,6 +201,7 @@ ).on "error", (e) -> console.log "Got error: " + e.message + return return