mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-14 06:42:16 +00:00
Remove returning results from import_eveapi, as this is causing excess stored results on RabbitMQ
This commit is contained in:
@@ -28,7 +28,7 @@ def queue_apikey_updates(update_delay=86400, batch_size=50):
|
|||||||
import_apikey.delay(api_key=acc.api_key, api_userid=acc.api_user_id)
|
import_apikey.delay(api_key=acc.api_key, api_userid=acc.api_user_id)
|
||||||
|
|
||||||
|
|
||||||
@task()
|
@task(ignore_result=True)
|
||||||
def import_apikey(api_userid, api_key, user=None, force_cache=False):
|
def import_apikey(api_userid, api_key, user=None, force_cache=False):
|
||||||
|
|
||||||
log = import_apikey.get_logger('import_apikey')
|
log = import_apikey.get_logger('import_apikey')
|
||||||
@@ -59,8 +59,6 @@ def import_apikey(api_userid, api_key, user=None, force_cache=False):
|
|||||||
if acc.user:
|
if acc.user:
|
||||||
update_user_access.delay(user=acc.user.id)
|
update_user_access.delay(user=acc.user.id)
|
||||||
|
|
||||||
return acc
|
|
||||||
|
|
||||||
|
|
||||||
@task(ignore_result=True)
|
@task(ignore_result=True)
|
||||||
def import_alliance_details():
|
def import_alliance_details():
|
||||||
|
|||||||
@@ -108,10 +108,11 @@ def eveapi_refresh(request, userid=0):
|
|||||||
|
|
||||||
if request.is_ajax():
|
if request.is_ajax():
|
||||||
try:
|
try:
|
||||||
acc = task.wait(30)
|
task.wait(30)
|
||||||
return HttpResponse(serializers.serialize('json', [acc]), mimetype='application/javascript')
|
|
||||||
except celery.exceptions.TimeoutError:
|
except celery.exceptions.TimeoutError:
|
||||||
return HttpResponse(serializers.serialize('json', []), mimetype='application/javascript')
|
pass
|
||||||
|
acc = EVEAccount.objects.get(id=userid)
|
||||||
|
return HttpResponse(serializers.serialize('json', [acc]), mimetype='application/javascript')
|
||||||
else:
|
else:
|
||||||
messages.add_message(request, messages.INFO,"Key %s has been queued to be refreshed from the API" % acc.api_user_id)
|
messages.add_message(request, messages.INFO,"Key %s has been queued to be refreshed from the API" % acc.api_user_id)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user