From d2e0a564e190810d93e9d4ba335534bf8ee3d6d5 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Wed, 10 Oct 2012 16:27:22 -0400 Subject: [PATCH] api: Cast message ids to int before trying to compute the maximum. (imported from commit 1723c48758711b9ace3db95d82ad91c76512ffa3) --- api/common.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/common.py b/api/common.py index 6e7726ff95..cb67c2110c 100644 --- a/api/common.py +++ b/api/common.py @@ -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)