Modification to the cron methods to allow arguments to be passed to each call

This commit is contained in:
2010-10-18 12:19:22 +01:00
parent a3cbc5063c
commit ab67c55d90
5 changed files with 21 additions and 11 deletions

View File

@@ -14,7 +14,7 @@ class ClearStaleCache():
self.__logger = logging.getLogger(__name__)
return self.__logger
def job(self):
def job(self, args):
objs = CachedDocument.objects.filter(cached_until__lt=datetime.utcnow())
self._logger.info('Removing %s stale cache documents' % objs.count())
objs.delete()
@@ -30,7 +30,7 @@ class FlushCache():
self.__logger = logging.getLogger(__name__)
return self.__logger
def job(self):
def job(self, args):
objs = CachedDocument.objects.all()
self._logger.info('Removing %s stale cache documents' % objs.count())
objs.delete()