Skip to content

Commit

Permalink
fix sqlite commit freq
Browse files Browse the repository at this point in the history
  • Loading branch information
captn3m0 committed Mar 15, 2024
1 parent efe76c5 commit 06cb7e6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ We have some data available or change notifications configured, but there needs
- [ ] Go through PS archives to see other venue hosts.

## Museums in BLR

- [ ] https://en.wikipedia.org/wiki/Karnataka_Chitrakala_Parishath
- [ ] https://en.wikipedia.org/wiki/Venkatappa_Art_Gallery
- [ ] https://en.wikipedia.org/wiki/Gandhi_Bhavan,_Bengaluru
Expand Down
6 changes: 4 additions & 2 deletions src/event-fetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from w3lib.html import get_base_url
import sqlite3
import json

EVENT_JSON_FILES = [
'out/bic.json'
]
Expand Down Expand Up @@ -109,13 +110,14 @@ def create_events_table():
for (url, d) in get_events(session):
insert_event_json(conn, url, d)
i+=1
if i > 10:
if i %10 == 0:
conn.commit()

for (url, d) in get_local_events(EVENT_JSON_FILES):
insert_event_json(conn, url, d)
print(url)
i+=1
if i > 10:
if i %10 == 0:
conn.commit()
conn.commit()
conn.close()

0 comments on commit 06cb7e6

Please sign in to comment.