mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-14 14:52:15 +00:00
Make timeout setting definable, stop avoidable stack traces
This commit is contained in:
@@ -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 gargoyle.is_active('eve-cak') and acc.is_cak:
|
||||||
if not acc.has_access(3):
|
if not acc.has_access(3):
|
||||||
logger.error('Key %s does not have access to CharacterSheet' % acc.pk)
|
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 }
|
auth_params = {'keyid': acc.api_user_id, 'vcode': acc.api_key, 'characterid': character_id }
|
||||||
else:
|
else:
|
||||||
auth_params = {'userID': acc.api_user_id, 'apiKey': acc.api_key, 'characterID': character_id }
|
auth_params = {'userID': acc.api_user_id, 'apiKey': acc.api_key, 'characterID': character_id }
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ class CachedDocumentManager(models.Manager):
|
|||||||
|
|
||||||
return url
|
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
|
Transparently handles querying EVE API or retrieving the document from
|
||||||
the cache.
|
the cache.
|
||||||
@@ -57,7 +57,7 @@ class CachedDocumentManager(models.Manager):
|
|||||||
url = self.construct_url(url_path, params)
|
url = self.construct_url(url_path, params)
|
||||||
doc_key = sha1(url).hexdigest()
|
doc_key = sha1(url).hexdigest()
|
||||||
|
|
||||||
print url
|
logger.debug('Requesting URL: %s' 5 url)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
doc = super(CachedDocumentManager, self).get_query_set().get(pk=doc_key)
|
doc = super(CachedDocumentManager, self).get_query_set().get(pk=doc_key)
|
||||||
|
|||||||
Reference in New Issue
Block a user