def getOverallDeferredSemaphore():
global OVERALL_SEMAPHORE
if OVERALL_SEMAPHORE is None:
preferences = zope.component.queryUtility(
ICollectorPreferences, 'zenpython')
if preferences:
OVERALL_SEMAPHORE = defer.DeferredSemaphore(preferences.options.twistedconcurrenthttp)
else:
# When we are running in a daemon other than zenpython, the preferences
# value will not be available
OVERALL_SEMAPHORE = defer.DeferredSemaphore(DEFAULT_TWISTEDCONCURRENTHTTP)
return OVERALL_SEMAPHORE
评论列表
文章目录