thing: Don't commit to memcached until committed to postgres.

This prevents a situation where we make a change to a Thing, write it to
memcached, then fail while committing to Postgres.
This commit is contained in:
Neil Williams
2013-09-20 15:41:03 -07:00
parent 7c9d9742d5
commit e5a0e1b364

View File

@@ -286,13 +286,12 @@ class DataThing(object):
del self._dirties[k]
else:
self._dirties.clear()
self._cache_myself()
except:
rollback()
raise
else:
commit()
self._cache_myself()
finally:
if lock:
lock.release()