Fix the retry logic when something goes wrong publishing
Previously we'd accidentally count it as an error when the retry succeeded, this caused weird results.
Previously we'd accidentally count it as an error when the retry succeeded, this caused weird results.