diff --git a/agkyra/cli.py b/agkyra/cli.py index 5f55e67bb5175b2e4b809f1cb52a004353d18bc8..3c7bf084c48e28608c2333869633393532d0eafc 100644 --- a/agkyra/cli.py +++ b/agkyra/cli.py @@ -306,7 +306,3 @@ class AgkyraCLI(cmd.Cmd): else: sys.stderr.write('Not running\n') sys.stderr.flush() - - def do_florist(self, line): - """RUN FLORIST, RUN!""" - sys.stderr.write('RUN: %s\n' % STATUS) diff --git a/agkyra/protocol.py b/agkyra/protocol.py index 16ce932aca1c1dd008a885d36779c7e7ff9597b8..946be599eb7641e64bb69be1afb8c0d7702b0560 100644 --- a/agkyra/protocol.py +++ b/agkyra/protocol.py @@ -38,6 +38,7 @@ with open(os.path.join(CURPATH, 'ui_common.json')) as f: UI_COMMON = json.load(f) STATUS = UI_COMMON['STATUS'] + def retry_on_locked_db(method, *args, **kwargs): """If DB is locked, wait and try again""" wait = kwargs.get('wait', 0.2) @@ -68,7 +69,7 @@ class SessionHelper(object): LOG.debug('Connect to db') self.db = sqlite3.connect(self.session_db) - self._init_db_relation() + retry_on_locked_db(self._init_db_relation) def _init_db_relation(self): """Create the session relation"""