Commit e75b5e89 authored by Nick Groenen's avatar Nick Groenen

Close storage of BotRepoManager on shutdown

This was a tricky one. I could reproduce this on one machine but not
another. A curious difference between the two was that they were using
different dbm implementations.

On the problematic one:
    data/repomgr.db.db: Berkeley DB (Hash, version9, native byte-order)

On the one that wouldn't reproduce the issue:
   data/repomgr.db: GNU dbm 1.x or ndbm database, little endian, old

Note also the Berkeley DB implementation adds an extra `.db` to the
filename which the GNU dbm implementation does not.

It appears the Berkeley version needs a clean `.close()` or it won't
persist updated values, GNU dbm updates them immediately.

Fixes #650
parent d2d4307a
......@@ -607,3 +607,4 @@ class ErrBot(Backend, StoreMixin):
def shutdown(self):
self.close_storage()
self.plugin_manager.shutdown()
self.repo_manager.shutdown()
......@@ -83,6 +83,9 @@ class BotRepoManager(StoreMixin):
self.plugin_dir = plugin_dir
self.open_storage(storage_plugin, 'repomgr')
def shutdown(self):
self.close_storage()
def check_for_index_update(self):
if REPO_INDEX not in self:
log.info('No repo index, creating it.')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment