0001-threads-make-sure-logger-and-substitution-singletons.patch
wcs/qommon/__init__.py | ||
---|---|---|
48 | 48 |
def __init__(self, *args, **kwargs): |
49 | 49 |
self.publisher = copy.copy(get_publisher()) |
50 | 50 |
if self.publisher: |
51 |
self.publisher.pgconn = None
|
|
51 |
self.publisher.reset()
|
|
52 | 52 |
super(TenantAwareThread, self).__init__(*args, **kwargs) |
53 | 53 | |
54 | 54 |
def run(self): |
wcs/qommon/publisher.py | ||
---|---|---|
767 | 767 |
publisher.set_config() |
768 | 768 |
return publisher |
769 | 769 | |
770 |
def reset(self): |
|
771 |
# reset structures that would otherwise be shared between threads |
|
772 |
self.pgconn = None |
|
773 |
self._app_logger = None |
|
774 |
self.substitutions = Substitutions() |
|
775 | ||
770 | 776 |
extra_dirs = None |
771 | 777 |
@classmethod |
772 | 778 |
def register_extra_dir(cls, dir): |
773 |
- |