diff --git a/bin/vg-index b/bin/vg-index index 1e321ce..796cae8 100755 --- a/bin/vg-index +++ b/bin/vg-index @@ -36,7 +36,10 @@ def open_db(): LIB.mkdir(parents=True, exist_ok=True) THUMBS.mkdir(parents=True, exist_ok=True) db = sqlite3.connect(DB, timeout=60) - db.execute("PRAGMA journal_mode=WAL") # concurrent index jobs on one node + try: # WAL is persistent once set; the switch itself needs an exclusive + db.execute("PRAGMA journal_mode=WAL") # lock, so tolerate losing the race + except sqlite3.OperationalError: + pass db.executescript(""" CREATE TABLE IF NOT EXISTS videos( id INTEGER PRIMARY KEY, path TEXT UNIQUE, mtime REAL, duration REAL,