From b16a60d383c4e7563af0d288155a7c1239adaca9 Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Tue, 7 Apr 2015 14:24:47 -0700 Subject: [PATCH] Fix error in double upload If more than one uploadreviewtask is submitted for a message, the message will not exist for the second or later task. In that case, do not throw a traceback into the log. Change-Id: I53bc0ff2b9e0bbdea5eeaa823a438cd48d337fa4 --- gertty/sync.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gertty/sync.py b/gertty/sync.py index 151862a..467558e 100644 --- a/gertty/sync.py +++ b/gertty/sync.py @@ -930,6 +930,10 @@ class UploadReviewTask(Task): with app.db.getSession() as session: message = session.getMessage(self.message_key) + if message is None: + self.log.debug("Message %s for change %s has already been uploaded" % ( + self.message_key, change.id)) + return change = message.revision.change if not change.held: self.log.debug("Syncing %s to find out if it should be held" % (change.id,))