commit be414ba97986cceae77cce3446d252a1b1e6d3ff parent 4166e1810eb06820640e3c4c984b544ac9b5622a Author: Samuel Walladge <samuel@swalladge.id.au> Date: Mon, 23 Jan 2017 19:28:19 +1030 re-add function call to verify notes saved on exit - this was commented out due to hangs on exit (ref https://github.com/insanum/sncli/issues/18#issuecomment-105517773 ) - should be fine now that we're using the requests library instead of urllib2 Diffstat:
M | simplenote_cli/sncli.py | | | 20 | +++++++++----------- |
1 file changed, 9 insertions(+), 11 deletions(-)
diff --git a/simplenote_cli/sncli.py b/simplenote_cli/sncli.py @@ -893,17 +893,15 @@ def gui_reset(self): def gui_stop(self): # don't exit if there are any notes not yet saved to the disk - # TODO - verify_all_saved() was deadlocking for me. urllib2.urlopen() isn't timing out appropriately if connection is down. - # if self.ndb.verify_all_saved(): - # # clear the screen and exit the urwid run loop - # self.gui_clear() - # raise urwid.ExitMainLoop() - # else: - # self.log(u'WARNING: Not all notes saved to disk (wait for sync worker)') - - # clear the screen and exit the urwid run loop - self.gui_clear() - raise urwid.ExitMainLoop() + # NOTE: this was originally causing hangs on exit with urllib2 + # should not be a problem now since using the requests library + # ref https://github.com/insanum/sncli/issues/18#issuecomment-105517773 + if self.ndb.verify_all_saved(): + # clear the screen and exit the urwid run loop + self.gui_clear() + raise urwid.ExitMainLoop() + else: + self.log(u'WARNING: Not all notes saved to disk (wait for sync worker)') def gui(self, key):