Skip to content

Commit

Permalink
Multiprocessing support for MAC
Browse files Browse the repository at this point in the history
  • Loading branch information
athiruma committed Aug 6, 2024
1 parent 29ee21d commit 6c0744b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion cloud_governance/main/main.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import os
import platform
from multiprocessing import set_start_method

import typeguard
from ast import literal_eval # str to dict
import boto3 # regions
Expand Down Expand Up @@ -328,4 +331,9 @@ def run_gcp_policy_runner():
run_policy(account=account, policy=policy, region=region_env, dry_run=dry_run)


main()
if __name__ == '__main__':
# spawn default in mac:
# https://docs.python.org/3/library/multiprocessing.html#:~:text=The%20default%20on%20Windows%20and%20macOS.
if 'macos' in platform.platform(terse=True).lower():
set_start_method('fork')
main()

0 comments on commit 6c0744b

Please sign in to comment.