Skip to content
Snippets Groups Projects
Commit 37518424 authored by Henrik tom Wörden's avatar Henrik tom Wörden
Browse files

Merge branch 'f-timeout-fallback' into 'master'

ENH: Fallback for timeout.

See merge request caosdb/caosdb-advanced-user-tools!11
parents 3ada1d35 9d50801a
No related branches found
No related tags found
No related merge requests found
......@@ -30,6 +30,7 @@ import argparse
import caosdb as db
timeout_fallback = 20
def convert_size(size):
if (size == 0):
......@@ -44,7 +45,7 @@ def convert_size(size):
def loadpath(path, include, exclude, prefix, dryrun, forceAllowSymlinks):
if dryrun is True:
if dryrun:
print("DRYRUN")
files = db.Container().retrieve(
unique=False,
......@@ -102,9 +103,12 @@ def main(argv=None):
parser.add_argument('-t', '--timeout', dest="timeout",
help="timeout in seconds for the database requests. "
"0 means no timeout. [defaults to the global "
"setting: %(default)s]",
"setting, else to {timeout_fallback}s: "
"%(default)s]".format(
timeout_fallback=timeout_fallback),
metavar="TIMEOUT",
default=db.get_config().get("Connection", "timeout"))
default=db.get_config().get("Connection", "timeout",
fallback=timeout_fallback))
parser.add_argument(dest="path",
help="path to folder with source file(s) "
"[default: %(default)s]", metavar="path")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment