Augment Tornado logging about failed user_profile loads.

(imported from commit 94fb3d6ce3eb8565b8c55eaf281a3ee7df6061f7)
This commit is contained in:
Tim Abbott
2014-01-08 10:59:16 -05:00
committed by Waseem Daher
parent 7d23bffa42
commit 0e7e6610ce

View File

@@ -103,13 +103,15 @@ def cache_load_message_data(message_id, users):
for user_profile_id, user_profile in user_profiles.iteritems():
if user_profile:
continue
if not settings.TEST_SUITE:
logging.warning("Tornado failed to load user profile from memcached when delivering message!")
user_profile = UserProfile.objects.select_related().get(id=user_profile_id)
user_profiles[user_profile_id] = user_profile
cache_save_user_profile(user_profile)
if not settings.TEST_SUITE:
logging.warning("Tornado failed to load user profile %s from memcached when delivering message!" %
(user_profile.email,))
return message, user_profiles
def receiver_is_idle(user_profile, realm_presences):