[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [bridgedb/master] Consider it a fatal error if we can't listen on the configured EMAIL_PORT.
commit d777231c1ea31f9748a84ab068b5d5c86bbdac6b
Author: Isis Lovecruft <isis@xxxxxxxxxxxxxx>
Date: Wed Jun 4 17:18:59 2014 +0000
Consider it a fatal error if we can't listen on the configured EMAIL_PORT.
---
lib/bridgedb/email/server.py | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/lib/bridgedb/email/server.py b/lib/bridgedb/email/server.py
index 50c5987..11af8df 100644
--- a/lib/bridgedb/email/server.py
+++ b/lib/bridgedb/email/server.py
@@ -23,6 +23,7 @@ import socket
from twisted.internet import defer
from twisted.internet import reactor
+from twisted.internet.error import CannotListenError
from twisted.internet.task import LoopingCall
from twisted.mail import smtp
from twisted.mail.smtp import rfc822date
@@ -418,7 +419,11 @@ def addServer(config, distributor, schedule):
addr = config.EMAIL_BIND_IP or ""
port = config.EMAIL_PORT
- reactor.listenTCP(port, factory, interface=addr)
+ try:
+ reactor.listenTCP(port, factory, interface=addr)
+ except CannotListenError as error:
+ logging.fatal(error)
+ raise SystemExit(error.message)
# Set up a LoopingCall to run every 30 minutes and forget old email times.
lc = LoopingCall(distributor.cleanDatabase)
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits