Removed django_cron dependancy, use manual started cronjobs

This commit is contained in:
2010-03-23 09:43:04 +00:00
parent 8a2bd17e0e
commit 484a459987
21 changed files with 37 additions and 877 deletions

View File

@@ -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)

View File

@@ -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)

View File

@@ -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()