Created
May 12, 2015 20:12
-
-
Save mbroadhead/d9da0fd3c2b13ba5cf33 to your computer and use it in GitHub Desktop.
Rex::Transaction never calls the rollback code.
This file contains hidden or 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
use Rex -base; | |
use Rex::Transaction; | |
task "test" => sub { | |
# This never gets called because Rex::Transaction::transaction() empties out the @ROLLBACKS array | |
# see here: | |
# grep -A1 "Cleaning ROLLBACKS array" lib/Rex/Transaction.pm | |
# | |
on_rollback { | |
Rex::Logger::info("rolling back test task"); | |
}; | |
transaction { | |
say "command 1 success"; | |
die "command 2 fail"; | |
say "shouldn't get to command 3"; | |
}; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment