diff --git a/rover/manager.py b/rover/manager.py index b4a1f0e..7eb8eb6 100644 --- a/rover/manager.py +++ b/rover/manager.py @@ -891,6 +891,7 @@ def _update_stats(self): with self._db: # single transaction self._db.cursor().execute('BEGIN') self._db.execute('DELETE FROM rover_download_stats', tuple()) + self._db.commit() for source in self._sources.values(): progress = source.stats() self._db.execute('''INSERT INTO rover_download_stats diff --git a/rover/process.py b/rover/process.py index 0ec7fd2..2be68b7 100644 --- a/rover/process.py +++ b/rover/process.py @@ -59,6 +59,7 @@ def _current_command_inside_transaction(self): else: self._log.debug('Removing dead process %s/%d' % (candidate, pid)) self._db.execute('DELETE FROM rover_processes WHERE pid = ?', (pid,)) + self._db.commit() except StopIteration: pass # table is empty try: diff --git a/rover/sqlite.py b/rover/sqlite.py index 833b877..af993f8 100644 --- a/rover/sqlite.py +++ b/rover/sqlite.py @@ -15,7 +15,8 @@ def init_db(dbpath, log): """ log.debug('Connecting to sqlite3 %s' % dbpath) - db = connect(dbpath, timeout=60.0) + # Timeout is in seconds + db = connect(dbpath, timeout=120.0) # https://www.sqlite.org/foreignkeys.html db.execute('PRAGMA foreign_keys = ON') db.execute('PRAGMA case_sensitive_like = ON') # as used by mseedindex