Add additional task completion guard to suppress late callbacks.
This commit is contained in:
parent
2a438e68a7
commit
f7ca8da8f9
@ -104,13 +104,17 @@
|
|||||||
timingOutIn: timeout) { (receivedParameter) in
|
timingOutIn: timeout) { (receivedParameter) in
|
||||||
// Queue the results for merge.
|
// Queue the results for merge.
|
||||||
parametersWorkQueue.async {
|
parametersWorkQueue.async {
|
||||||
if (returnedList[index] != nil) {
|
guard !complete else {
|
||||||
MVMCoreLoggingHandler.addError(toLog: MVMCoreErrorObject(title: nil, message: "Client parameter \(parameterType) has already executed. The completion handler should only be called once!", code: ErrorCode.default.rawValue, domain: ErrorDomainNative, location: String(describing: ClientParameterHandler.self))!)
|
MVMCoreLoggingHandler.logDebugMessage(withDelegate: "Client \(parameterType) responded after task completion.")
|
||||||
} else {
|
return
|
||||||
MVMCoreLoggingHandler.shared()?.logCoreEvent(.clientParameterFetchComplete(name: parameterType, uuid: requestUUID[index], actionId: actionId))
|
|
||||||
returnedList[index] = receivedParameter
|
|
||||||
group.leave() // Leaving is only done after setup (barriered).
|
|
||||||
}
|
}
|
||||||
|
guard returnedList[index] == nil else {
|
||||||
|
MVMCoreLoggingHandler.addError(toLog: MVMCoreErrorObject(title: nil, message: "Client parameter \(parameterType) has already executed. The completion handler should only be called once!", code: ErrorCode.default.rawValue, domain: ErrorDomainNative, location: String(describing: ClientParameterHandler.self))!)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
MVMCoreLoggingHandler.shared()?.logCoreEvent(.clientParameterFetchComplete(name: parameterType, uuid: requestUUID[index], actionId: actionId))
|
||||||
|
returnedList[index] = receivedParameter
|
||||||
|
group.leave() // Leaving is only done after setup (barriered).
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user