mirror of
https://github.com/GAM-team/GAM.git
synced 2026-06-16 20:21:37 +00:00
Two fixes (#1226)
* Set maxtasksperchild to help avoid hangs especially on Windows * Fix function reference
This commit is contained in:
@@ -10959,7 +10959,7 @@ def run_batch(items):
|
||||
if not items:
|
||||
return
|
||||
num_worker_threads = min(len(items), GC_Values[GC_NUM_THREADS])
|
||||
pool = mp_pool(num_worker_threads, init_gam_worker)
|
||||
pool = mp_pool(num_worker_threads, init_gam_worker, maxtasksperchild=200)
|
||||
sys.stderr.write(f'Using {num_worker_threads} processes...\n')
|
||||
try:
|
||||
results = []
|
||||
|
||||
@@ -7,6 +7,7 @@ from gam import display
|
||||
from gam import fileutils
|
||||
from gam import gapi
|
||||
from gam.gapi import directory as gapi_directory
|
||||
from gam.gapi.directory import orgunits as gapi_directory_orgunits
|
||||
from gam import utils
|
||||
|
||||
|
||||
@@ -32,7 +33,7 @@ def doUpdateCros():
|
||||
update_body['annotatedAssetId'] = sys.argv[i + 1]
|
||||
i += 2
|
||||
elif myarg in ['ou', 'org']:
|
||||
orgUnitPath = gam.getOrgUnitItem(sys.argv[i + 1])
|
||||
orgUnitPath = gapi_directory_orgunits.getOrgUnitItem(sys.argv[i + 1])
|
||||
i += 2
|
||||
elif myarg == 'action':
|
||||
action = sys.argv[i + 1].lower().replace('_', '').replace('-', '')
|
||||
@@ -358,7 +359,7 @@ def doPrintCrosActivity():
|
||||
queries = gam.getQueries(myarg, sys.argv[i + 1])
|
||||
i += 2
|
||||
elif myarg == 'limittoou':
|
||||
orgUnitPath = gam.getOrgUnitItem(sys.argv[i + 1])
|
||||
orgUnitPath = gapi_directory_orgunits.getOrgUnitItem(sys.argv[i + 1])
|
||||
i += 2
|
||||
elif myarg == 'todrive':
|
||||
todrive = True
|
||||
@@ -526,7 +527,7 @@ def doPrintCrosDevices():
|
||||
queries = gam.getQueries(myarg, sys.argv[i + 1])
|
||||
i += 2
|
||||
elif myarg == 'limittoou':
|
||||
orgUnitPath = gam.getOrgUnitItem(sys.argv[i + 1])
|
||||
orgUnitPath = gapi_directory_orgunits.getOrgUnitItem(sys.argv[i + 1])
|
||||
i += 2
|
||||
elif myarg == 'todrive':
|
||||
todrive = True
|
||||
|
||||
Reference in New Issue
Block a user