diff --git a/beat/web/backend/schedule.py b/beat/web/backend/schedule.py index 8234642d9cf93776e45e6563c014f6b52dc05540..cea079a9750396051b20955226758fbaab20c8db 100644 --- a/beat/web/backend/schedule.py +++ b/beat/web/backend/schedule.py @@ -405,7 +405,7 @@ def worker_update(): @transaction.atomic -def work(environments, cpulimit, process): +def work(environments, cpulimit, process, settings): '''Launches user code on isolated processes This function is supposed to be called asynchronously, by a scheduling @@ -429,6 +429,9 @@ def work(environments, cpulimit, process): process (str): The path to the ``process.py`` program to use for running the user code on isolated processes. + settings (str): The name of the module containing the Django settings for + use with the process program + ''' # myself, raises if I cannot find me @@ -441,7 +444,7 @@ def work(environments, cpulimit, process): j.end(None, Job.CANCELLED) # cmdline base argument - cmdline = [process] + cmdline = [process, '--settings=%s' % settings] if cpulimit is not None: cmdline += ['--cpulimit=%s' % cpulimit] if settings.DEBUG: cmdline += ['-vv'] diff --git a/beat/web/scripts/worker.py b/beat/web/scripts/worker.py index 21f4472989841d09218b192c98e2b9369a18d37f..d5c17b06e1b8cf9311dca0bfca54b5a990eb2949 100644 --- a/beat/web/scripts/worker.py +++ b/beat/web/scripts/worker.py @@ -124,7 +124,7 @@ def main(user_input=None): while not stop: start = time.time() - work(environments, cpulimit, process) + work(environments, cpulimit, process, arguments['--settings']) currtime = time.time() duration = currtime - start