diff options
author | Patrick Totzke <patricktotzke@gmail.com> | 2016-03-12 14:23:43 +0000 |
---|---|---|
committer | Patrick Totzke <patricktotzke@gmail.com> | 2016-03-12 14:23:43 +0000 |
commit | a0034268573062075615ff117c74da65b2791af2 (patch) | |
tree | 9ca525c6bb636ee6a102903a081e776c11b236aa /alot | |
parent | 621c2288e1c2f4c04ccd7888801031f15165b8f8 (diff) |
set flush_retry_timeout=0 to prevent retry
Diffstat (limited to 'alot')
-rw-r--r-- | alot/commands/globals.py | 17 | ||||
-rw-r--r-- | alot/defaults/alot.rc.spec | 3 |
2 files changed, 11 insertions, 9 deletions
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-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 |