]> git.ipfire.org Git - people/ms/dma.git/commit
implement queue flushing prod
authorSimon Schubert <2@0x2c.org>
Sat, 18 Feb 2012 00:15:22 +0000 (01:15 +0100)
committerSimon Schubert <2@0x2c.org>
Sat, 18 Feb 2012 00:15:22 +0000 (01:15 +0100)
commit3686aecc4a2ebd388e0879ff069ee6bf42f3e50e
treeaf5cd49cc85078354571e18d36f4f92cd27de530
parente33faafea635e82a5c2018bc02718fdb68f09143
implement queue flushing prod

So far dma would sleep for the whole backoff period before retrying a
delivery.  However, this also meant that a user issuing `dma -q` could
not force these mails to be retried immediately.

Switch to sleeping for only 30 seconds at a time, and poll the mtime
of a special queue flush signal file `flush` in the spool directory.
If the flush file has been touched since the beginning of the backoff
period, initiate a retry right away.

When flushing the queue with `dma -q` we now touch the flush file to
make waiting instances of dma process this user request.

The 30 second poll interval at the same time avoids a DoS via
excessive `dma -q` by any user.

fixes #3
Bug: https://github.com/corecode/dma/issues/3
dma.c
dma.h
spool.c