Skip to content

Commit

Permalink
Immediately(ish) remove temporary config files created for ad hoc ser…
Browse files Browse the repository at this point in the history
…vers

They're annoying. :)
  • Loading branch information
Jim Fulton committed Aug 4, 2016
1 parent 9613f09 commit a07f8af
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions README.rst
Expand Up @@ -180,12 +180,10 @@ Which is a short-hand for::
connection = db.open()

If you exit the Python process, the storage exits as well, as it's run
in an in-process thread. It will leave behind it's configuration and
log file. This provides a handy way to get a configuration example.
in an in-process thread.

You shut down the server more cleanly by calling the stop function
returned by the ``ZEO.server`` function. This will remove the
temporary configuration file.
returned by the ``ZEO.server`` function.

To have data stored persistently, you can specify a file-storage path
name using a ``path`` parameter. If you want blob support, you can
Expand Down
2 changes: 1 addition & 1 deletion src/ZEO/tests/forker.py
Expand Up @@ -139,6 +139,7 @@ def runner(config, qin, qout, timeout=None,
)
thread.setDaemon(True)
thread.start()
os.remove(config)

try:
qin.get(timeout=timeout) # wait for shutdown
Expand Down Expand Up @@ -181,7 +182,6 @@ def stop_runner(thread, config, qin, qout, stop_timeout=9, pid=None):
gc.collect()

thread.join(stop_timeout)
os.remove(config)

def start_zeo_server(storage_conf=None, zeo_conf=None, port=None, keep=False,
path='Data.fs', protocol=None, blob_dir=None,
Expand Down

0 comments on commit a07f8af

Please sign in to comment.