Skip to content

Commit

Permalink
Put defer into its own function.
Browse files Browse the repository at this point in the history
  • Loading branch information
tiger5226 committed Dec 4, 2019
1 parent 73fa89a commit 217114f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions daemon/jobs/certificatesync.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ func CertificateSync() {
if !certificateSyncRunning {
logrus.Debug("Running Certificate Sync...")
certificateSyncRunning = true
defer func() {
certificateSyncRunning = false
}()
defer endCertificateSync()
claims, err := getClaimsToBeSynced()
if err != nil {
logrus.Error(certificateSyncPrefix+" Unable to get claims that need certificates checked", errors.Err(err))
Expand Down Expand Up @@ -56,6 +54,10 @@ func CertificateSync() {
}
}

func endCertificateSync() {
certificateSyncRunning = false
}

func certifyClaim(claimToBeSynced claimToBeSynced) (bool, error) {

signedHelper, err := c.DecodeClaimHex(claimToBeSynced.SignedClaimHex, global.BlockChainName)
Expand Down

0 comments on commit 217114f

Please sign in to comment.