##// END OF EJS Templates
events: reduce usage of threadglobals in global imports for gevent
super-admin -
r5068:d9f07e87 default
parent child Browse files
Show More
@@ -17,7 +17,7 b''
17 # and proprietary license terms, please see https://rhodecode.com/licenses/
17 # and proprietary license terms, please see https://rhodecode.com/licenses/
18
18
19 import logging
19 import logging
20 from pyramid.threadlocal import get_current_registry
20
21 from rhodecode.events.base import RhodeCodeIntegrationEvent
21 from rhodecode.events.base import RhodeCodeIntegrationEvent
22
22
23 from rhodecode.events.base import ( # pragma: no cover
23 from rhodecode.events.base import ( # pragma: no cover
@@ -71,6 +71,8 b' def trigger(event, registry=None):'
71 # For the first step we are using pyramids thread locals here. If the
71 # For the first step we are using pyramids thread locals here. If the
72 # event mechanism works out as a good solution we should think about
72 # event mechanism works out as a good solution we should think about
73 # passing the registry as an argument to get rid of it.
73 # passing the registry as an argument to get rid of it.
74 from pyramid.threadlocal import get_current_registry
75
74 event_name = event.__class__
76 event_name = event.__class__
75 log.debug('event %s sent for execution', event_name)
77 log.debug('event %s sent for execution', event_name)
76 registry = registry or get_current_registry()
78 registry = registry or get_current_registry()
General Comments 0
You need to be logged in to leave comments. Login now