From d1269466ab01d87feba436675a74469ce6af8ab3 Mon Sep 17 00:00:00 2001 From: denkhaus Date: Thu, 29 Dec 2016 18:14:13 +0100 Subject: [PATCH] autopush@1483031653 --- engine.go | 2 +- followers.go | 2 +- graph.go | 2 +- mentions.go | 2 +- tweets.go | 2 +- user.go | 30 ++++++++++++++++-------------- 6 files changed, 21 insertions(+), 19 deletions(-) diff --git a/engine.go b/engine.go index 9585b73..bfde8cc 100644 --- a/engine.go +++ b/engine.go @@ -7,7 +7,7 @@ import ( "net/url" "github.com/ChimeraCoder/anaconda" - "github.com/denkhaus/neoism" + "github.com/jmcvetta/neoism" "github.com/juju/errors" "github.com/kurrik/oauth1a" "github.com/kurrik/twittergo" diff --git a/followers.go b/followers.go index 4cd103f..5b32c4c 100644 --- a/followers.go +++ b/followers.go @@ -5,7 +5,7 @@ import ( "net/http" "net/url" - "github.com/denkhaus/neoism" + "github.com/jmcvetta/neoism" "github.com/juju/errors" ) diff --git a/graph.go b/graph.go index 4c40dc9..7f3262b 100644 --- a/graph.go +++ b/graph.go @@ -5,7 +5,7 @@ import ( // "github.com/davecgh/go-spew/spew" "strconv" - "github.com/denkhaus/neoism" + "github.com/jmcvetta/neoism" "github.com/juju/errors" ) diff --git a/mentions.go b/mentions.go index 4989e70..92acf9f 100644 --- a/mentions.go +++ b/mentions.go @@ -1,7 +1,7 @@ package main import ( - "github.com/denkhaus/neoism" + "github.com/jmcvetta/neoism" "github.com/juju/errors" ) diff --git a/tweets.go b/tweets.go index 4c13726..45eb2e4 100644 --- a/tweets.go +++ b/tweets.go @@ -5,7 +5,7 @@ import ( "net/http" "net/url" - "github.com/denkhaus/neoism" + "github.com/jmcvetta/neoism" "github.com/juju/errors" "github.com/kurrik/twittergo" ) diff --git a/user.go b/user.go index 0a80b3e..c6bf082 100644 --- a/user.go +++ b/user.go @@ -4,7 +4,7 @@ import ( // "github.com/davecgh/go-spew/spew" "time" - "github.com/denkhaus/neoism" + "github.com/jmcvetta/neoism" "github.com/juju/errors" ) @@ -17,21 +17,23 @@ func (p *Engine) completeUsers(db *neoism.Database) error { ids := res.FilterResultsBy("id").ToInt64Slice() - if len(ids) > 0 { - logger.Infof("%d user ids need completion -> fetch", len(ids)) - twUsers, err := p.api.GetUsersLookupByIds(ids, nil) - if err != nil { - return errors.Annotate(err, "lookup users by ids") - } + if len(ids) == 0 { + return nil + } - props := neoism.Props{ - "users": twUsers, - } + logger.Infof("%d user ids need completion -> fetch", len(ids)) + twUsers, err := p.api.GetUsersLookupByIds(ids, nil) + if err != nil { + return errors.Annotate(err, "lookup users by ids") + } - logger.Infof("got data for %d users -> apply", len(twUsers)) - if _, err := p.execQuery(db, CYPHER_USERS_UPDATE_BY_ID, props); err != nil { - return errors.Annotate(err, "users update by id") - } + props := neoism.Props{ + "users": twUsers, + } + + logger.Infof("got data for %d users -> apply", len(twUsers)) + if _, err := p.execQuery(db, CYPHER_USERS_UPDATE_BY_ID, props); err != nil { + return errors.Annotate(err, "users update by id") } return nil