a8n: Ensure Campaign is not processing when closing/deleting
Created by: mrnugget
This does two things:
-
It checks that the Campaign to be closed/deleted is not processing (changesets are currently being created on the codehost). If a Campaign were deleted/closed while being processed we might leave changesets open on the code hosts.
-
It makes sure that the transactions in the two methods are committed before starting a goroutine that closes the changesets. That removes a race condition in which the goroutine would try to close changesets even though the transaction could not be committed (due to concurrent updates for examples).
Closes #8241