Skip to content

Commit

Permalink
Refs #73: fixed scheduler on Windows and documented about pythonw.exe
Browse files Browse the repository at this point in the history
  • Loading branch information
dolamroth committed Feb 9, 2024
1 parent 41ddbe5 commit 7898a7b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions docs/contrib/scheduler.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,9 @@ python command.py scheduler run d41d8cd98f00b204e9800998ecf8427e # run by OS-sc
- `PERIODIC_JOBS_USERNAME` (str, Windows only) - by default `"System"`
- `PERIODIC_JOBS_PASSWORD` (str, Windows only) - by default `None`
- `PERIODIC_JOBS_BACKEND` (str) - path to override default backend class - by default `None`

#### Note about console popup on Windows

If Windows scheduler task with default Python executable shows up console popup on each run,
you may want to substitute `python.exe` with `pythonw.exe` in `PERIODIC_JOBS_PYTHON_EXECUTABLE`.
Note, that it has its own [caveats](https://stackoverflow.com/a/30313091).
2 changes: 1 addition & 1 deletion starlette_web/contrib/scheduler/backends/win32.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def update_jobs(self):
execution_time_limit=False,
force_stop=True,
delete_after=False,
multiple_instances=not self.settings.LOCK_JOBS,
multiple_instances=["Parallel", "No New Instance"][self.settings.LOCK_JOBS],
action_type="Execute",
cmd=self.settings.PYTHON_EXECUTABLE,
arguments=(
Expand Down

0 comments on commit 7898a7b

Please sign in to comment.