Created
June 10, 2012 09:56
-
-
Save gnosek/2904726 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@task | |
def a_celery_task(pxid): | |
try: | |
do_something() | |
except Exception: | |
two_phase_commit.rollback_prepared(pxid) | |
else: | |
two_phase_commit.commit_prepared(pxid) | |
def defer_something(): | |
pxid = two_phase_commit.prepare_transaction() | |
return a_celery_task.defer(pxid) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment