Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(472)

Unified Diff: state/state.go

Issue 30390043: state: refactor addmachine.go
Patch Set: state: refactor addmachine.go Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « state/machine.go ('k') | state/unit.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: state/state.go
=== modified file 'state/state.go'
--- state/state.go 2013-11-28 09:07:52 +0000
+++ state/state.go 2013-12-03 18:10:09 +0000
@@ -87,9 +87,14 @@
transactionHooks := <-st.transactionHooks
st.transactionHooks <- nil
if len(transactionHooks) > 0 {
+ // Note that this code should only ever be triggered
+ // during tests. If we see the log messages below
+ // in a production run, something is wrong.
defer func() {
if transactionHooks[0].After != nil {
+ logger.Infof("transaction 'after' hook start")
transactionHooks[0].After()
+ logger.Infof("transaction 'after' hook end")
}
if <-st.transactionHooks != nil {
panic("concurrent use of transaction hooks")
@@ -97,7 +102,9 @@
st.transactionHooks <- transactionHooks[1:]
}()
if transactionHooks[0].Before != nil {
+ logger.Infof("transaction 'before' hook start")
transactionHooks[0].Before()
+ logger.Infof("transaction 'before' hook end")
}
}
return st.runner.Run(ops, "", nil)
« no previous file with comments | « state/machine.go ('k') | state/unit.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b