[Zodb-checkins] CVS: Packages/ZEO - ClientStorage.py:1.26.4.21
jeremy@digicool.com
jeremy@digicool.com
Wed, 16 May 2001 23:19:44 -0400 (EDT)
Update of /cvs-repository/Packages/ZEO
In directory korak.digicool.com:/tmp/cvs-serv7109
Modified Files:
Tag: ZEO-ZRPC-Dev
ClientStorage.py
Log Message:
Add wait_for_server_on_startup keyword arg support.
--- Updated File ClientStorage.py in package Packages/ZEO --
--- ClientStorage.py 2001/05/09 15:17:33 1.26.4.20
+++ ClientStorage.py 2001/05/17 03:19:43 1.26.4.21
@@ -142,7 +142,7 @@
def __init__(self, addr, storage='1', cache_size=20000000,
name='', client='', debug=0, var=None,
min_disconnect_poll=5, max_disconnect_poll=300,
- wait_for_server_on_starup=1):
+ wait_for_server_on_startup=1):
# Decide whether to use non-temporary files
client = client or os.environ.get('ZEO_CLIENT','')
@@ -150,7 +150,7 @@
self._connection = addr
self._storage = storage
self._debug = debug
- self._wait_for_server_on_starup = wait_for_server_on_starup
+ self._wait_for_server_on_startup = wait_for_server_on_startup
self._info = {'length': 0, 'size': 0, 'name': 'ZEO Client',
'supportsUndo':0, 'supportsVersions': 0}
@@ -175,9 +175,11 @@
tmin=min_disconnect_poll,
tmax=max_disconnect_poll)
self._server = None
- # XXX make this method call the default CnMgr behavior?
- if not self._rpc_mgr.attempt_connect():
- self._rpc_mgr.connect()
+ if wait_for_server_on_startup:
+ self._rpc_mgr.connect(1)
+ else:
+ if not self._rpc_mgr.attempt_connect():
+ self._rpc_mgr.connect()
def _basic_init(self, name):
"""Handle initialization activites of BaseStorage"""