Open almico opened 7 years ago
I have the same problem, people told me sqlite problems, use another database
Interesting. Thank you. I will look for some information about how to migrate from sqlite3 to mysql.
It is caused by incorrect use of database API objects in notification.py. My notification system rewrite (#214) will fix this problem, but if you're in a hurry for a short-term fix, you can apply this patch to your monocle instance:
diff --git a/monocle/notification.py b/monocle/notification.py
index 754ccf4..3a2ba95 100755
--- a/monocle/notification.py
+++ b/monocle/notification.py
@@ -720,8 +720,10 @@ class Notifier:
seen = pokemon['seen'] % 3600
cache_handle = self.cache.store.add(pokemon['encounter_id'])
try:
- with session_scope() as session:
- tth = await run_threaded(estimate_remaining_time, session, pokemon['spawn_id'], seen)
+ def xxx_estimate_remaining_time_with_session():
+ with session_scope() as session:
+ return estimate_remaining_time(session, pokemon['spawn_id'], seen)
+ tth = await run_threaded(xxx_estimate_remaining_time_with_session)
except Exception:
self.log.exception('An exception occurred while trying to estimate remaining time.')
now_epoch = time()
Thank you @mewio 😃 I took the opportunity to move to MySQL (with some fiddling I managed to port everything), but I think your fix will be much appreciated by a lot of users.
Notifications use their own DB that is different than where sightings are kept?
I looked at scan.log from scan.py (using the latest available Monocle source code) and found multiple errors like this. This is one of them: