Migrated the final cronjobs over to tasks

This commit is contained in:
2010-11-10 12:15:43 +00:00
parent f7657a7325
commit db28b3902a
8 changed files with 22 additions and 146 deletions

View File

@@ -1,25 +0,0 @@
import logging
import datetime
from eve_api.models.api_player import EVEAccount, EVEPlayerCorporation, EVEPlayerCharacter
import eve_api.api_puller.accounts
from eve_api.api_puller.alliances import __start_full_import as alliance_import
from eve_api.api_puller.corp_management import pull_corp_members
from eve_api.api_exceptions import APIAuthException, APINoUserIDException
from eve_api.app_defines import *
from eve_api.tasks import *
class AllianceUpdate():
"""
Pulls the AllianceList.xml.aspx and updates the alliance objects
"""
@property
def _logger(self):
if not hasattr(self, '__logger'):
self.__logger = logging.getLogger(__name__)
return self.__logger
def job(self, args):
alliance_import()

View File

@@ -60,6 +60,12 @@ def import_apikey(api_userid, api_key, user=None, force_cache=False):
return acc
@task(ignore_result=True, rate_limit='10/d')
def import_alliance_details():
from eve_api.api_puller.alliances import __start_full_import as alliance_import
alliance_import()
@task(ignore_result=True, rate_limit='5/m')
def import_corp_members(api_userid, api_key, character_id):
pull_corp_members(api_key, api_userid, character_id)