api: Cast message ids to int before trying to compute the maximum.

(imported from commit 1723c48758711b9ace3db95d82ad91c76512ffa3)
This commit is contained in:
Tim Abbott 2012-10-10 16:27:22 -04:00
parent c2117a58e1
commit d2e0a564e1
1 changed files with 2 additions and 2 deletions

View File

@ -68,6 +68,6 @@ class HumbugAPI():
# TODO: Make this back off once it's more reliable
time.sleep(1)
continue
for message in sorted(res['messages'], key=lambda x: x["id"]):
max_message_id = max(max_message_id, message["id"])
for message in sorted(res['messages'], key=lambda x: int(x["id"])):
max_message_id = max(max_message_id, int(message["id"]))
callback(message)