You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to implement custom job class (same as ShellJob but which run only once)
I made a class:
"""A job to run executable programs ONLY ONCE."""fromsubprocessimportcallfromndscheduler.coreschedulerimportjobclassShellJobOnce(job.JobBase):
@classmethoddefmeta_info(cls):
return {
'job_class_string': '%s.%s'% (cls.__module__, cls.__name__),
'notes': ('This will run an executable program ONLY ONCE. You can specify as many ''arguments as you want. This job will pass these arguments to the ''program in order.'),
'arguments': [
{'type': 'string', 'description': 'Executable path'}
],
'example_arguments': '["/usr/local/telegram_notify.pl", "user_id", "arg2"]'
}
defrun(self, *args, **kwargs):
code=call(args)
self.scheduler_manager.pause_job(self.job_id);
#self.scheduler_manager.remove_job(self.job_id);return {'returncode': code}
if__name__=="__main__":
# You can easily test this job herejob=ShellJobOnce.create_test_instance()
job.run('at', '-h')
I'd like to implement custom job class (same as ShellJob but which run only once)
I made a class:
and run NDScheduler using docker-compose like:
After that I get at http://localhost:8888/
Could you please explain me why such happened?
My module has same import
from ndscheduler.corescheduler import job
sting as original ShellJobP.S. Even if I mount same ShellJob module with same content inside
wenbinf/ndscheduler
container I got same error.The text was updated successfully, but these errors were encountered: