watch is now cmd line arg
Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
This commit is contained in:
		| @ -87,7 +87,6 @@ class Conf: | ||||
|     def worker(self) -> dict[str, Any]: | ||||
|         return { | ||||
|             "use_gevent": False, | ||||
|             "watch": settings.DEBUG, | ||||
|             "watch_use_polling": False, | ||||
|             "processes": None, | ||||
|             "threads": None, | ||||
|  | ||||
| @ -19,17 +19,25 @@ class Command(BaseCommand): | ||||
|             dest="pid_file", | ||||
|             help="PID file", | ||||
|         ) | ||||
|         parser.add_argument( | ||||
|             "--watch", | ||||
|             action="store_true", | ||||
|             default=False, | ||||
|             dest="watch", | ||||
|             help="Watch for file changes", | ||||
|         ) | ||||
|  | ||||
|     def handle( | ||||
|         self, | ||||
|         pid_file, | ||||
|         watch, | ||||
|         verbosity, | ||||
|         **options, | ||||
|     ): | ||||
|         worker = Conf().worker | ||||
|         executable_name = "dramatiq-gevent" if worker["use_gevent"] else "dramatiq" | ||||
|         executable_path = self._resolve_executable(executable_name) | ||||
|         watch_args = ["--watch", "."] if worker["watch"] else [] | ||||
|         watch_args = ["--watch", "."] if watch else [] | ||||
|         if watch_args and worker["watch_use_polling"]: | ||||
|             watch_args.append("--watch-use-polling") | ||||
|  | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Marc 'risson' Schmitt
					Marc 'risson' Schmitt