diff options
| author | Barry Warsaw | 2013-01-20 16:23:09 -0500 |
|---|---|---|
| committer | Barry Warsaw | 2013-01-20 16:23:09 -0500 |
| commit | ccef4d2b12333c4177a557081b0b39dc1c29dd8b (patch) | |
| tree | 10d1da23353e17a670a3b7cea2c3f3bfed47bc87 /src/mailman/core/runner.py | |
| parent | 8f9ff6711aa42dad7e01393202103bc98ebdaeea (diff) | |
| parent | dde63003c1b489744dce6b3181b95276ec88a1da (diff) | |
| download | mailman-ccef4d2b12333c4177a557081b0b39dc1c29dd8b.tar.gz mailman-ccef4d2b12333c4177a557081b0b39dc1c29dd8b.tar.zst mailman-ccef4d2b12333c4177a557081b0b39dc1c29dd8b.zip | |
Diffstat (limited to 'src/mailman/core/runner.py')
| -rw-r--r-- | src/mailman/core/runner.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/mailman/core/runner.py b/src/mailman/core/runner.py index f088e29bb..a8412195d 100644 --- a/src/mailman/core/runner.py +++ b/src/mailman/core/runner.py @@ -52,6 +52,7 @@ elog = logging.getLogger('mailman.error') @implementer(IRunner) class Runner: intercept_signals = True + is_queue_runner = True def __init__(self, name, slice=None): """Create a runner. @@ -66,10 +67,16 @@ class Runner: section = getattr(config, 'runner.' + name) substitutions = config.paths substitutions['name'] = name - self.queue_directory = expand(section.path, substitutions) numslices = int(section.instances) - self.switchboard = Switchboard( - name, self.queue_directory, slice, numslices, True) + # Check whether the runner is queue runner or not; non-queue runner + # should not have queue_directory or switchboard instance. + if self.is_queue_runner: + self.queue_directory = expand(section.path, substitutions) + self.switchboard = Switchboard( + name, self.queue_directory, slice, numslices, True) + else: + self.queue_directory = None + self.switchboard= None self.sleep_time = as_timedelta(section.sleep_time) # sleep_time is a timedelta; turn it into a float for time.sleep(). self.sleep_float = (86400 * self.sleep_time.days + |
