mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-14 06:42:16 +00:00
Removed django_cron dependancy, use manual started cronjobs
This commit is contained in:
@@ -22,12 +22,10 @@ def import_eve_account(api_key, user_id):
|
||||
"""
|
||||
Imports an account from the API into the EVEAccount model.
|
||||
"""
|
||||
print user_id, ":", api_key
|
||||
auth_params = {'userID': user_id, 'apiKey': api_key}
|
||||
account_doc = CachedDocument.objects.api_query('/account/Characters.xml.aspx',
|
||||
params=auth_params,
|
||||
no_cache=False)
|
||||
#print account_doc.body
|
||||
|
||||
dom = minidom.parseString(account_doc.body)
|
||||
|
||||
|
||||
@@ -1,18 +1,14 @@
|
||||
import logging
|
||||
|
||||
from django_cron import cronScheduler, Job
|
||||
from eve_api.models.api_player import EVEAccount, EVEPlayerCorporation
|
||||
import eve_api.api_puller.accounts
|
||||
from eve_api.api_exceptions import APIAuthException, APINoUserIDException
|
||||
|
||||
class UpdateAPIs(Job):
|
||||
class UpdateAPIs():
|
||||
"""
|
||||
Updates all Eve API elements in the database
|
||||
"""
|
||||
|
||||
# run every 2 hours
|
||||
run_every = 7200
|
||||
|
||||
@property
|
||||
def _logger(self):
|
||||
if not hasattr(self, '__logger'):
|
||||
@@ -36,6 +32,3 @@ class UpdateAPIs(Job):
|
||||
|
||||
for corp in EVEPlayerCorporation.objects.all():
|
||||
corp.query_and_update_corp()
|
||||
|
||||
|
||||
cronScheduler.register(UpdateAPIs)
|
||||
|
||||
@@ -192,9 +192,7 @@ class EVEPlayerCorporation(EVEAPIModel):
|
||||
continue
|
||||
except IndexError:
|
||||
# Something weird has happened
|
||||
print " * Index Error:", tag_map[0]
|
||||
continue
|
||||
|
||||
print "Updating", self.id, self.name
|
||||
self.api_last_updated = datetime.utcnow()
|
||||
self.save()
|
||||
|
||||
Reference in New Issue
Block a user