Author: joes
Date: Mon Mar 12 02:02:37 2012
New Revision: 1299519
URL: http://svn.apache.org/viewvc?rev=1299519&view=rev
Log:
* trunk/tools/server-side/svnpubsub/svnpubsub/client.py
Force the reconnect to eventually happen. There is probably a better way of
doing this, but for now this code is both necessary and sufficient.
Modified:
subversion/trunk/tools/server-side/svnpubsub/svnpubsub/client.py
Modified: subversion/trunk/tools/server-side/svnpubsub/svnpubsub/client.py
URL:
http://svn.apache.org/viewvc/subversion/trunk/tools/server-side/svnpubsub/svnpubsub/client.py?rev=1299519&r1=1299518&r2=1299519&view=diff
==============================================================================
--- subversion/trunk/tools/server-side/svnpubsub/svnpubsub/client.py (original)
+++ subversion/trunk/tools/server-side/svnpubsub/svnpubsub/client.py Mon Mar 12
02:02:37 2012
@@ -74,7 +74,15 @@ class Client(asynchat.async_chat):
self.skipping_headers = True
self.create_socket(socket.AF_INET, socket.SOCK_STREAM)
- self.connect((host, port))
+ while True:
+ try:
+ self.connect((host, port))
+ break
+ except:
+ self.event_callback('connect failed, reconnecting in %d seconds'
+ % (RECONNECT_DELAY))
+ time.sleep(RECONNECT_DELAY)
+
### should we allow for repository restrictions?
self.push('GET /commits/xml HTTP/1.0\r\n\r\n')