mirror of
https://github.com/goauthentik/authentik.git
synced 2026-06-17 19:09:11 +03:00
packages/django-dramatiq-postgres: fix worker startup on macos (cherry-pick #20637 to version-2026.2) (#20641)
packages/django-dramatiq-postgres: fix worker startup on macos (#20637) fix worker startup on macos Co-authored-by: Simonyi Gergő <28359278+gergosimonyi@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
fc6f8374e6
commit
29d880920e
+5
-1
@@ -1,3 +1,4 @@
|
||||
import platform
|
||||
import sys
|
||||
from argparse import Namespace
|
||||
from multiprocessing import set_start_method
|
||||
@@ -70,7 +71,10 @@ class Command(BaseCommand):
|
||||
args.pid_file = pid_file
|
||||
|
||||
args.verbose = verbosity - 1
|
||||
set_start_method("fork")
|
||||
# > On macOS [...] the fork start method should be considered unsafe
|
||||
# https://docs.python.org/3/library/multiprocessing.html#contexts-and-start-methods
|
||||
if not platform.system() == "Darwin":
|
||||
set_start_method("fork")
|
||||
connections.close_all()
|
||||
sys.exit(main(args)) # type: ignore[no-untyped-call]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user