mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-14 06:42:16 +00:00
Moved service enable/disable functions to the update_access() function on the user profile
This will remove the need for the cronjob, but not totally, best still to run the cronjob to catch situations where the permission changes can be missed.
This commit is contained in:
13
run-cron.py
13
run-cron.py
@@ -2,12 +2,13 @@
|
||||
"""Executes a Django cronjob"""
|
||||
|
||||
import sys
|
||||
import logging
|
||||
from django.core.management import setup_environ
|
||||
import settings
|
||||
|
||||
setup_environ(settings)
|
||||
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
logging.basicConfig(level=logging.DEBUG)
|
||||
log = logging.getLogger('runcron')
|
||||
|
||||
try:
|
||||
@@ -19,11 +20,11 @@ for i in sys.argv[1].split(".")[1:]:
|
||||
mod = getattr(mod, i)
|
||||
cron_class = getattr(mod, sys.argv[2])()
|
||||
|
||||
log.info("Starting Job %s in %s" % (sys.argv[2], sys.argv[1])
|
||||
log.info("Starting Job %s in %s" % (sys.argv[2], sys.argv[1]))
|
||||
|
||||
try:
|
||||
cron_class.job()
|
||||
except:
|
||||
log.error("Error executing job, aborting.")
|
||||
#try:
|
||||
cron_class.job()
|
||||
#except:
|
||||
# log.error("Error executing job, aborting.")
|
||||
|
||||
log.info("Job complete")
|
||||
|
||||
Reference in New Issue
Block a user