Fix dealing with dates that don't have a timezone. For now, just skip them

This commit is contained in:
IamTheFij 2019-12-25 16:26:53 +00:00
parent b4c690aeb3
commit 854b090145

View File

@ -122,7 +122,10 @@ class MailCrawler(object):
print('DDB Processed message. Message date: {} Old date: {}'.format( print('DDB Processed message. Message date: {} Old date: {}'.format(
message_date, since_date message_date, since_date
)) ))
try:
since_date = max(since_date, message_date) since_date = max(since_date, message_date)
except TypeError:
print("Error comparing dates. We'll just use the last one")
print('DDB Since date is now ', since_date) print('DDB Since date is now ', since_date)
last_message = max(uid, last_message) last_message = max(uid, last_message)