Make get_user_id blueslip errors clear again.

We had a theory that get_user_id() errors were often due to race
conditions related to reloads, so we would only report missing
user ids if subsequent lookups failed 5 seconds later.  It turns
out we still get the blueslip errors, and now we don't get
meaningful tracebacks.  This change makes it so that errors
get reported immediately again.
This commit is contained in:
Steve Howell
2017-03-03 16:36:02 -08:00
committed by showell
parent 66371009e2
commit b611ecfa1e

View File

@@ -80,17 +80,8 @@ exports.update_email = function (user_id, new_email) {
exports.get_user_id = function (email) {
var person = people.get_by_email(email);
if (person === undefined) {
// Our blueslip reporting here is a bit complicated, but
// there are known race conditions after reload, and we
// expect occasional failed lookups, but they should resolve
// after five seconds.
var error_msg = 'Unknown email for get_user_id: ' + email;
blueslip.debug(error_msg);
setTimeout(function () {
if (!people_dict.has(email)) {
blueslip.error(error_msg);
}
}, 5000);
blueslip.error(error_msg);
return undefined;
}
var user_id = person.user_id;