mirror of
https://github.com/corda/corda.git
synced 2025-04-07 11:27:01 +00:00
Merge pull request #7155 from corda/adel/ENT-6743
ENT-6743: SuspensionMeta in FlowInfo is null when a runnable flow has previously been hospitalized
This commit is contained in:
commit
bc6a6ee2ae
@ -104,17 +104,6 @@ class StaffedFlowHospital(private val flowMessaging: FlowMessaging,
|
||||
* Flows should be removed from [flowsInHospital] when they have completed a successful transition.
|
||||
*/
|
||||
private val flowsInHospital = ConcurrentHashMap<StateMachineRunId, FlowFiber>()
|
||||
|
||||
/**
|
||||
* Returns true if the flow is currently being treated in the hospital.
|
||||
* The differs to flows with a medical history (which can accessed via [StaffedFlowHospital.contains]).
|
||||
*/
|
||||
@VisibleForTesting
|
||||
internal fun flowInHospital(runId: StateMachineRunId): Boolean {
|
||||
// The .keys avoids https://youtrack.jetbrains.com/issue/KT-18053
|
||||
return runId in flowsInHospital.keys
|
||||
}
|
||||
|
||||
private val mutex = ThreadBox(object {
|
||||
/**
|
||||
* Contains medical history of every flow (a patient) that has entered the hospital. A flow can leave the hospital,
|
||||
@ -348,7 +337,7 @@ class StaffedFlowHospital(private val flowMessaging: FlowMessaging,
|
||||
}
|
||||
}
|
||||
|
||||
operator fun contains(flowId: StateMachineRunId) = mutex.locked { flowId in flowPatients }
|
||||
operator fun contains(flowId: StateMachineRunId) = flowId in flowsInHospital.keys
|
||||
|
||||
override fun close() {
|
||||
hospitalJobTimer.cancel()
|
||||
|
Loading…
x
Reference in New Issue
Block a user