Skip to content

Commit 81d346a

Browse files
author
SM_SAYEED
committed
manual code modification to stop crashing
1 parent e6df758 commit 81d346a

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

app.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,9 @@ def auto_log_material_files():
118118
c = conn.cursor()
119119
# Ensure uniqueness constraint exists
120120
c.execute("""
121-
CREATE UNIQUE INDEX IF NOT EXISTS idx_unique_uploads
122-
ON uploads_log(property, tab, filename)
123-
""")
121+
INSERT OR IGNORE INTO uploads_log(property, tab, filename, logged_at)
122+
VALUES (?, ?, ?, CURRENT_TIMESTAMP)
123+
""", (property, tab, filename))
124124
conn.commit()
125125

126126
for root, dirs, files in os.walk(UPLOAD_FOLDER):
@@ -669,7 +669,11 @@ def extract_drive_id(link):
669669
print(rule.endpoint, rule)
670670

671671
auto_import_uploads()
672-
auto_log_material_files()
672+
try:
673+
auto_log_material_files()
674+
except Exception as e:
675+
print("auto_log_material_files skipped:", e)
676+
673677

674678
# ========== MAIN ==========
675679
if __name__ == '__main__':

0 commit comments

Comments
 (0)