detect invalid config (prevent db loss)

This commit is contained in:
ed 2024-11-15 08:04:58 +00:00
parent 1f177528c1
commit 2b63d7d10d

View file

@ -1732,7 +1732,18 @@ class AuthSrv(object):
self.log("\n\n".join(ta) + "\n", c=3) self.log("\n\n".join(ta) + "\n", c=3)
vfs.histtab = {zv.realpath: zv.histpath for zv in vfs.all_vols.values()} rhisttab = {}
vfs.histtab = {}
for zv in vfs.all_vols.values():
histp = zv.histpath
if histp in rhisttab:
zv2 = rhisttab[histp]
t = "invalid config; multiple volumes share the same histpath (database location):\n histpath: %s\n volume 1: /%s [%s]\n volume 2: %s [%s]"
t = t % (histp, zv2.vpath, zv2.realpath, zv.vpath, zv.realpath)
self.log(t, 1)
raise Exception(t)
rhisttab[histp] = zv
vfs.histtab[zv.realpath] = histp
for vol in vfs.all_vols.values(): for vol in vfs.all_vols.values():
lim = Lim(self.log_func) lim = Lim(self.log_func)