Allow for the call to define the timeout, set at a default of 30secs

This commit is contained in:
2011-06-15 12:07:08 +01:00
parent bdcb572645
commit edac3d83dc
2 changed files with 3 additions and 3 deletions

View File

@@ -131,7 +131,7 @@ class OpTimerHandler(BaseHandler):
error_doc = {'ops': [{'startsIn': -1, 'eventID': 0, 'ownerName': '', 'eventDate': '', 'eventTitle': '<div style="text-align:center">The EVE API calendar is unavailable</div>', 'duration': 0, 'isImportant': 0, 'eventText': 'Fuck CCP tbqh imho srsly', 'endsIn':-1, 'forumLink': ''}]}
try:
cached_doc = CachedDocument.objects.api_query('/char/UpcomingCalendarEvents.xml.aspx', params, service="Optimer")
cached_doc = CachedDocument.objects.api_query('/char/UpcomingCalendarEvents.xml.aspx', params, timeout=10, service="Optimer")
except DocumentRetrievalError:
return error_doc
dom = minidom.parseString(cached_doc.body.encode('utf-8'))