Hi Terry,

> The module sys.exit() looks useful, but I keep getting:
> Job "check_webserver_commands (trigger: interval[0:00:01], paused)"
> raised an exception
> Traceback (most recent call last):
>   File 
> "/usr/local/lib/python3.7/dist-packages/apscheduler/executors/base.py", line 
> 125, in run_job
>     retval = job.func(*job.args, **job.kwargs)
>   File "minstermusic.py", line 444, in check_webserver_commands
>     sys.exit()
> SystemExit
> but it doesn't actually exit the program and I have to Ctrl-C to get out 
> fully, which means it doesn't save the trace.

This is still the counting trace which writes at the end?

It looks like whatever considers minstermusic.py a ‘job’ is catching all
exceptions, including the SystemExit raised by sys.exit().  So you need
to look at its documentation to

- Confirm it's catching the exception because your contract with it is
  you won't raise SystemExit.
- Find out its defined way of having your job indicate it's finished and
  shouldn't be called any more.  Hopefully, it's the only job and then
  the job-runner will exit.

Cheers, Ralph.

  Next meeting: Online, Jitsi, Tuesday, 2021-03-02 20:00
  Check to whom you are replying
  Meetings, mailing list, IRC, ...  http://dorset.lug.org.uk
  New thread, don't hijack:  mailto:dorset@mailman.lug.org.uk

Reply via email to