|
|
|
@ -375,11 +375,11 @@ func handleFetchCollectionInbox(app *App, w http.ResponseWriter, r *http.Request |
|
|
|
|
// Add follower locally, since it wasn't found before
|
|
|
|
|
res, err := t.Exec("INSERT INTO remoteusers (actor_id, inbox, shared_inbox) VALUES (?, ?, ?)", fullActor.ID, fullActor.Inbox, fullActor.Endpoints.SharedInbox) |
|
|
|
|
if err != nil { |
|
|
|
|
if !app.db.isDuplicateKeyErr(err) { |
|
|
|
|
t.Rollback() |
|
|
|
|
log.Error("Couldn't add new remoteuser in DB: %v\n", err) |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
// if duplicate key, res will be nil and panic on
|
|
|
|
|
// res.LastInsertId below
|
|
|
|
|
t.Rollback() |
|
|
|
|
log.Error("Couldn't add new remoteuser in DB: %v\n", err) |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
followerID, err = res.LastInsertId() |
|
|
|
|