Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZEO
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
ZEO
Commits
b66484c3
Commit
b66484c3
authored
Jan 30, 2002
by
Jeremy Hylton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add -W option to wait forever for server.
parent
171981ae
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
9 deletions
+20
-9
src/scripts/zeopack.py
src/scripts/zeopack.py
+20
-9
No files found.
src/scripts/zeopack.py
View file @
b66484c3
...
@@ -15,6 +15,9 @@ Options:
...
@@ -15,6 +15,9 @@ Options:
-d days -- pack objects more than days old
-d days -- pack objects more than days old
-W -- wait for server to come up. Normally the script tries to
connect for 10 seconds, then exits with an error.
You must specify either -p and -h or -U.
You must specify either -p and -h or -U.
"""
"""
...
@@ -40,14 +43,19 @@ def connect(storage):
...
@@ -40,14 +43,19 @@ def connect(storage):
return
return
raise
RuntimeError
,
"Unable to connect to ZEO server"
raise
RuntimeError
,
"Unable to connect to ZEO server"
def
pack
(
addr
,
storage
,
days
):
def
pack
(
addr
,
storage
,
days
,
wait
):
cs
=
ClientStorage
(
addr
,
storage
=
storage
,
wait_for_server_on_startup
=
1
)
cs
=
ClientStorage
(
addr
,
storage
=
storage
,
wait_for_server_on_startup
=
wait
)
# _startup() is an artifact of the way ZEO 1.0 works. The
if
wait
:
# ClientStorage doesn't get fully initialized until registerDB()
# _startup() is an artifact of the way ZEO 1.0 works. The
# is called. The only thing we care about, though, is that
# ClientStorage doesn't get fully initialized until registerDB()
# registerDB() calls _startup().
# is called. The only thing we care about, though, is that
connect
(
cs
)
# registerDB() calls _startup().
cs
.
_startup
()
else
:
connect
(
cs
)
cs
.
invalidator
=
None
cs
.
pack
(
wait
=
1
,
days
=
days
)
cs
.
pack
(
wait
=
1
,
days
=
days
)
cs
.
close
()
def
usage
(
exit
=
1
):
def
usage
(
exit
=
1
):
print
__doc__
print
__doc__
...
@@ -60,8 +68,9 @@ def main():
...
@@ -60,8 +68,9 @@ def main():
unix
=
None
unix
=
None
storage
=
'1'
storage
=
'1'
days
=
0
days
=
0
wait
=
0
try
:
try
:
opts
,
args
=
getopt
.
getopt
(
sys
.
argv
[
1
:],
'p:h:U:S:d:'
)
opts
,
args
=
getopt
.
getopt
(
sys
.
argv
[
1
:],
'p:h:U:S:d:
W
'
)
for
o
,
a
in
opts
:
for
o
,
a
in
opts
:
if
o
==
'-p'
:
if
o
==
'-p'
:
port
=
int
(
a
)
port
=
int
(
a
)
...
@@ -73,6 +82,8 @@ def main():
...
@@ -73,6 +82,8 @@ def main():
storage
=
a
storage
=
a
elif
o
==
'-d'
:
elif
o
==
'-d'
:
days
=
int
(
a
)
days
=
int
(
a
)
elif
o
==
'-W'
:
wait
=
1
except
Exception
,
err
:
except
Exception
,
err
:
print
err
print
err
usage
()
usage
()
...
@@ -86,7 +97,7 @@ def main():
...
@@ -86,7 +97,7 @@ def main():
usage
()
usage
()
addr
=
host
,
port
addr
=
host
,
port
pack
(
addr
,
storage
,
days
)
pack
(
addr
,
storage
,
days
,
wait
)
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
try
:
try
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment