T13: produksi web dengan gunicorn + WAL (gunicorn.conf.py, DASH_WORKERS, V12)
This commit is contained in:
1 parent
0374f9f4c2
commit
2b95be3091
8 files changed
+42
-7
No files matched your search
+6
-1
@@ -97,10 +97,15 @@ def normalize(row):
|
||||
|
||||
|
||||
def persist(rows):
|
||||
"""V7: ganti snapshot — DROP+INSERT tiap skan, ⊥ history/append."""
|
||||
"""V7: ganti snapshot — DROP+INSERT tiap skan, ⊥ history/append.
|
||||
|
||||
WAL: journal_mode=WAL → pembaca (dashboard multi-worker) tak terblokir
|
||||
saat DROP+INSERT harian. Mode ini persisten setelah diset.
|
||||
"""
|
||||
scanned_at = datetime.now().isoformat(timespec='seconds')
|
||||
conn = sqlite3.connect(DB_PATH)
|
||||
try:
|
||||
conn.execute('PRAGMA journal_mode=WAL')
|
||||
conn.execute('DROP TABLE IF EXISTS voters') # snapshot bersih
|
||||
conn.execute(
|
||||
'CREATE TABLE voters (' # I.db
|
||||
|
||||
Reference in new issue
Block a user