commit manually since autocommit=True might only work for new keys
parent
1f602aa14a
commit
826a631fd1
|
@ -99,6 +99,7 @@ class DramaClient:
|
||||||
return []
|
return []
|
||||||
|
|
||||||
db["last_processed_id"] = max(c["id"] for c in comments)
|
db["last_processed_id"] = max(c["id"] for c in comments)
|
||||||
|
db.commit()
|
||||||
|
|
||||||
# New comments may have pushed others to page n+1 while fetching.
|
# New comments may have pushed others to page n+1 while fetching.
|
||||||
deduped_comments = {c["id"]: c for c in comments}.values()
|
deduped_comments = {c["id"]: c for c in comments}.values()
|
||||||
|
|
6
data.py
6
data.py
|
@ -12,9 +12,5 @@ def load_config():
|
||||||
return yaml.safe_load(f)
|
return yaml.safe_load(f)
|
||||||
|
|
||||||
|
|
||||||
def open_database():
|
|
||||||
return SqliteDict("db.sqlite", autocommit=True)
|
|
||||||
|
|
||||||
|
|
||||||
config = load_config()
|
config = load_config()
|
||||||
db = open_database()
|
db = SqliteDict(f"{config['data_dir']}/db.sqlite", autocommit=True)
|
||||||
|
|
Loading…
Reference in New Issue