Permalink
Browse files

Don't recreate pidantic factory on every action

Leaks supd unix domain sockets for one thing..
  • Loading branch information...
1 parent ebd1a20 commit 842abe7be07c579421d5e5a52adc58c97cad8365 @labisso labisso committed Oct 30, 2012
Showing with 6 additions and 1 deletion.
  1. +6 −1 epuharness/harness.py
View
@@ -45,12 +45,17 @@ def __init__(self, exchange=None, pidantic_dir=None, amqp_uri=None, config=None)
self.dashi = bootstrap.dashi_connect(self.CFG.dashi.topic, self.CFG, amqp_uri=amqp_uri)
self.amqp_cfg = dict(self.CFG.server.amqp)
+ self.factory = None
+
def _setup_factory(self):
+ if self.factory:
+ return
+
try:
self.factory = SupDPidanticFactory(directory=self.pidantic_dir,
name="epu-harness")
- except:
+ except Exception:
log.debug("Problem Connecting to SupervisorD", exc_info=True)
raise HarnessException("Could not connect to supervisord. Was epu-harness started?")

0 comments on commit 842abe7

Please sign in to comment.