abandon listing tags in browser when db busy

This commit is contained in:
ed 2021-06-20 21:19:47 +02:00
parent 357347ce3a
commit 2fcd0e7e72

View file

@ -1765,7 +1765,9 @@ class HttpCli(object):
fn = f["name"]
rd = f["rd"]
del f["rd"]
if icur:
if not icur:
break
if vn != dbv:
_, rd = vn.get_dbv(rd)
@ -1774,12 +1776,16 @@ class HttpCli(object):
try:
r = icur.execute(q, (rd, fn)).fetchone()
except Exception as ex:
if "database is locked" not in str(ex):
if "database is locked" in str(ex):
break
try:
args = s3enc(idx.mem_cur, rd, fn)
r = icur.execute(q, args).fetchone()
except:
self.log("tag list error:\n" + min_ex())
m = "tag list error, {}/{}\n{}"
self.log(m.format(rd, fn, min_ex()))
break
tags = {}
f["tags"] = tags
@ -1794,7 +1800,9 @@ class HttpCli(object):
taglist[k] = True
tags[k] = v
except:
self.log("tag read error:\n" + min_ex())
m = "tag read error, {}/{} [{}]:\n{}"
self.log(m.format(rd, fn, w, min_ex()))
break
if icur:
taglist = [k for k in vn.flags.get("mte", "").split(",") if k in taglist]