diff --git a/engine/ips.go b/engine/ips.go index 8dd8547b3..6a5faa487 100644 --- a/engine/ips.go +++ b/engine/ips.go @@ -104,8 +104,9 @@ func (ip *IPProfile) unlock() { if ip.lkID == utils.EmptyString { return } - guardian.Guardian.UnguardIDs(ip.lkID) + tmp := ip.lkID ip.lkID = utils.EmptyString + guardian.Guardian.UnguardIDs(tmp) } // IPUsage represents an usage counted. @@ -206,8 +207,10 @@ func (ip *IP) unlock() { if ip.lkID == utils.EmptyString { return } - guardian.Guardian.UnguardIDs(ip.lkID) + tmp := ip.lkID ip.lkID = utils.EmptyString + guardian.Guardian.UnguardIDs(tmp) + } type IPWithAPIOpts struct { diff --git a/engine/libstats.go b/engine/libstats.go index b3a482b24..5b6c14d82 100644 --- a/engine/libstats.go +++ b/engine/libstats.go @@ -119,8 +119,9 @@ func (sqp *StatQueueProfile) unlock() { if sqp.lkID == utils.EmptyString { return } - guardian.Guardian.UnguardIDs(sqp.lkID) + tmp := sqp.lkID sqp.lkID = utils.EmptyString + guardian.Guardian.UnguardIDs(tmp) } // isLocked returns the locks status of this StatQueueProfile @@ -320,8 +321,10 @@ func (sq *StatQueue) unlock() { if sq.lkID == utils.EmptyString { return } - guardian.Guardian.UnguardIDs(sq.lkID) + tmp := sq.lkID sq.lkID = utils.EmptyString + guardian.Guardian.UnguardIDs(tmp) + } // isLocked returns the locks status of this StatQueue diff --git a/engine/resources.go b/engine/resources.go index 9f6d8a754..af19b46f4 100644 --- a/engine/resources.go +++ b/engine/resources.go @@ -114,8 +114,10 @@ func (rp *ResourceProfile) unlock() { if rp.lkID == utils.EmptyString { return } - guardian.Guardian.UnguardIDs(rp.lkID) + tmp := rp.lkID rp.lkID = utils.EmptyString + guardian.Guardian.UnguardIDs(tmp) + } // isLocked returns the locks status of this resourceProfile @@ -228,8 +230,9 @@ func (r *Resource) unlock() { if r.lkID == utils.EmptyString { return } - guardian.Guardian.UnguardIDs(r.lkID) + tmp := r.lkID r.lkID = utils.EmptyString + guardian.Guardian.UnguardIDs(tmp) } // isLocked returns the locks status of this resource diff --git a/engine/thresholds.go b/engine/thresholds.go index cb5c07caa..86a53dd66 100644 --- a/engine/thresholds.go +++ b/engine/thresholds.go @@ -117,8 +117,9 @@ func (tp *ThresholdProfile) unlock() { if tp.lkID == utils.EmptyString { return } - guardian.Guardian.UnguardIDs(tp.lkID) + tmp := tp.lkID tp.lkID = utils.EmptyString + guardian.Guardian.UnguardIDs(tmp) } // isLocked returns the locks status of this ThresholdProfile @@ -209,8 +210,9 @@ func (t *Threshold) unlock() { if t.lkID == utils.EmptyString { return } - guardian.Guardian.UnguardIDs(t.lkID) + tmp := t.lkID t.lkID = utils.EmptyString + guardian.Guardian.UnguardIDs(tmp) } // isLocked returns the locks status of this threshold