mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-14 06:42:16 +00:00
Modification to the cron methods to allow arguments to be passed to each call
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user