Make timeout setting definable, stop avoidable stack traces

This commit is contained in:
2011-09-03 22:45:49 +01:00
parent f0ea081638
commit f3a51f3b95
2 changed files with 3 additions and 3 deletions

View File

@@ -122,7 +122,7 @@ def import_eve_character_func(character_id, key_id=None, logger=logging.getLogge
if gargoyle.is_active('eve-cak') and acc.is_cak:
if not acc.has_access(3):
logger.error('Key %s does not have access to CharacterSheet' % acc.pk)
raise APIAccessException
return
auth_params = {'keyid': acc.api_user_id, 'vcode': acc.api_key, 'characterid': character_id }
else:
auth_params = {'userID': acc.api_user_id, 'apiKey': acc.api_key, 'characterID': character_id }

View File

@@ -39,7 +39,7 @@ class CachedDocumentManager(models.Manager):
return url
def api_query(self, url_path, params={}, no_cache=False, exceptions=True, timeout=30, service="Auth"):
def api_query(self, url_path, params={}, no_cache=False, exceptions=True, timeout=settings.get('EVE_PROXY_TIMEOUT', 60), service="Auth"):
"""
Transparently handles querying EVE API or retrieving the document from
the cache.
@@ -57,7 +57,7 @@ class CachedDocumentManager(models.Manager):
url = self.construct_url(url_path, params)
doc_key = sha1(url).hexdigest()
print url
logger.debug('Requesting URL: %s' 5 url)
try:
doc = super(CachedDocumentManager, self).get_query_set().get(pk=doc_key)