Commit 7b5e6301 authored by Vincent Pelletier's avatar Vincent Pelletier

Factorise end-of-transaction cleanup code.

parent d067ddf1
...@@ -145,13 +145,12 @@ if memcache is not None: ...@@ -145,13 +145,12 @@ if memcache is not None:
LOG('MemcacheTool', 0, 'delete command to memcached server (%r) failed' % (self.server_list,)) LOG('MemcacheTool', 0, 'delete command to memcached server (%r) failed' % (self.server_list,))
except: except:
LOG('MemcachedDict', 0, 'An exception occured during _finish', error=True) LOG('MemcachedDict', 0, 'An exception occured during _finish', error=True)
self.scheduled_action_dict.clear() self.__cleanup()
self.local_cache.clear()
def _abort(self, *ignored): def _abort(self, *ignored):
""" self.__cleanup()
Cleanup the action dict and invalidate local cache.
""" def __cleanup(self):
self.local_cache.clear() self.local_cache.clear()
self.scheduled_action_dict.clear() self.scheduled_action_dict.clear()
......
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