mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-04-27 03:00:12 -04:00
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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user