From a0034268573062075615ff117c74da65b2791af2 Mon Sep 17 00:00:00 2001 From: Patrick Totzke Date: Sat, 12 Mar 2016 14:23:43 +0000 Subject: set flush_retry_timeout=0 to prevent retry --- alot/commands/globals.py | 17 +++++++++-------- alot/defaults/alot.rc.spec | 3 ++- 2 files changed, 11 insertions(+), 9 deletions(-) (limited to 'alot') diff --git a/alot/commands/globals.py b/alot/commands/globals.py index 5704b153..d234f54f 100644 --- a/alot/commands/globals.py +++ b/alot/commands/globals.py @@ -543,14 +543,15 @@ class FlushCommand(Command): except DatabaseLockedError: timeout = settings.get('flush_retry_timeout') - def f(*args): - self.apply(ui) - ui.mainloop.set_alarm_in(timeout, f) - if not ui.db_was_locked: - if not self.silent: - ui.notify( - 'index locked, will try again in %d secs' % timeout) - ui.db_was_locked = True + if timeout > 0: + def f(*args): + self.apply(ui) + ui.mainloop.set_alarm_in(timeout, f) + if not ui.db_was_locked: + if not self.silent: + ui.notify( + 'index locked, will try again in %d secs' % timeout) + ui.db_was_locked = True ui.update() return diff --git a/alot/defaults/alot.rc.spec b/alot/defaults/alot.rc.spec index 4abe2268..a02fecd5 100644 --- a/alot/defaults/alot.rc.spec +++ b/alot/defaults/alot.rc.spec @@ -85,7 +85,8 @@ edit_headers_whitelist = force_list(default=list(*,)) # see :ref:`edit_headers_whitelist ` edit_headers_blacklist = force_list(default=list(Content-Type,MIME-Version,References,In-Reply-To)) -# timeout in seconds after a failed attempt to writeout the database is repeated +# timeout in seconds after a failed attempt to writeout the database is +# repeated. Set to 0 for no retry. flush_retry_timeout = integer(default=5) # where to look up hooks -- cgit v1.2.3