File tree Expand file tree Collapse file tree 2 files changed +19
-2
lines changed
root/etc/s6-overlay/s6-rc.d/cwa-ingest-service Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change 11CONTRIBUTORS
22
33This file is automatically generated. DO NOT EDIT MANUALLY.
4- Generated on: 2025-09-02T13:37:40.355058Z
4+ Generated on: 2025-09-02T13:44:20.914655Z
55
66Upstream project: https://github.com/janeczku/calibre-web
77Fork project (Calibre-Web Automated, since 2024): https://github.com/crocodilestick/calibre-web-automated
Original file line number Diff line number Diff line change @@ -19,7 +19,24 @@ mkdir -p "/config/processed_books/failed" 2>/dev/null || true
1919# Function to get timeout from database
2020get_timeout_from_db () {
2121 local timeout_minutes
22- timeout_minutes=$( sqlite3 /config/cwa.db " SELECT ingest_timeout_minutes FROM cwa_settings LIMIT 1;" 2> /dev/null || echo " 15" )
22+ # Try sqlite3 first, fallback to Python if not available
23+ if command -v sqlite3 > /dev/null 2>&1 ; then
24+ timeout_minutes=$( sqlite3 /config/cwa.db " SELECT ingest_timeout_minutes FROM cwa_settings LIMIT 1;" 2> /dev/null || echo " 15" )
25+ else
26+ # Fallback to Python
27+ timeout_minutes=$( python3 -c "
28+ import sqlite3
29+ try:
30+ conn = sqlite3.connect('/config/cwa.db')
31+ cursor = conn.cursor()
32+ cursor.execute('SELECT ingest_timeout_minutes FROM cwa_settings LIMIT 1')
33+ result = cursor.fetchone()
34+ conn.close()
35+ print(result[0] if result else 15)
36+ except:
37+ print(15)
38+ " 2> /dev/null || echo " 15" )
39+ fi
2340 echo $(( timeout_minutes * 60 )) # Convert to seconds
2441}
2542
You can’t perform that action at this time.
0 commit comments