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