mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-19 20:59:24 +00:00
Moved exec script to cron infrastructure
This commit is contained in:
20
registration/cron.py
Normal file
20
registration/cron.py
Normal file
@@ -0,0 +1,20 @@
|
||||
import logging
|
||||
|
||||
from registration.models import RegistrationProfile
|
||||
|
||||
class RemoveExpiredProfiles():
|
||||
"""
|
||||
Deletes expired profile requests
|
||||
"""
|
||||
|
||||
# run every 2 hours
|
||||
run_every = 7200
|
||||
|
||||
@property
|
||||
def _logger(self):
|
||||
if not hasattr(self, '__logger'):
|
||||
self.__logger = logging.getLogger(__name__)
|
||||
return self.__logger
|
||||
|
||||
def job(self):
|
||||
RegistrationProfile.objects.delete_expired_users()
|
||||
Reference in New Issue
Block a user