# HG changeset patch # User RhodeCode Admin # Date 2023-07-18 09:28:33 # Node ID d9f07e87b42b90597d77fedb2a275ac1cbfc388f # Parent bf4fcdb77a8c970bfbce1ca84a8cc58d0d33098d events: reduce usage of threadglobals in global imports for gevent diff --git a/rhodecode/events/__init__.py b/rhodecode/events/__init__.py --- a/rhodecode/events/__init__.py +++ b/rhodecode/events/__init__.py @@ -17,7 +17,7 @@ # and proprietary license terms, please see https://rhodecode.com/licenses/ import logging -from pyramid.threadlocal import get_current_registry + from rhodecode.events.base import RhodeCodeIntegrationEvent from rhodecode.events.base import ( # pragma: no cover @@ -71,6 +71,8 @@ def trigger(event, registry=None): # For the first step we are using pyramids thread locals here. If the # event mechanism works out as a good solution we should think about # passing the registry as an argument to get rid of it. + from pyramid.threadlocal import get_current_registry + event_name = event.__class__ log.debug('event %s sent for execution', event_name) registry = registry or get_current_registry()