Skip to content

Commit

Permalink
autopush@1483789035
Browse files Browse the repository at this point in the history
  • Loading branch information
denkhaus committed Jan 7, 2017
1 parent 690f458 commit 68dcd0e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions user.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,19 @@ func (p *Engine) completeUsers(db *neoism.Database) error {
logger.Infof("%d user ids need completion -> fetch", len(ids))
twUsers, err := p.api.GetUsersLookupByIds(ids, nil)
if err != nil {
if apiErr, ok := err.(*anaconda.ApiError); ok {

if apiErr.StatusCode == 404 {
logger.Infof("mark user #%s as protected", idStr)
_, err = p.execQuery(db, CYPHER_USER_SET_PROTECTED, neoism.Props{
"id": idStr,
})
if err != nil {
return errors.Annotate(err, "set user protected")
}
}
}

return errors.Annotate(err, "lookup users by ids")
}

Expand Down

0 comments on commit 68dcd0e

Please sign in to comment.