Fix race condition waiting for message delivery
This commit is contained in:
parent
9feab409ab
commit
d9bd0c6e30
@ -79,7 +79,6 @@ final class DeviceManager {
|
||||
}
|
||||
do {
|
||||
try await socket.send(Array(message))
|
||||
await updateMessageCountMetric()
|
||||
} catch {
|
||||
throw MessageResult.deviceNotConnected
|
||||
}
|
||||
@ -88,6 +87,7 @@ final class DeviceManager {
|
||||
let result: Data = try await withCheckedThrowingContinuation { continuation in
|
||||
self.requestInProgress = continuation
|
||||
}
|
||||
await updateMessageCountMetric()
|
||||
return result
|
||||
}
|
||||
|
||||
@ -163,6 +163,7 @@ final class DeviceManager {
|
||||
self?.didCloseDeviceSocket()
|
||||
}
|
||||
}
|
||||
log("[INFO] Socket connected")
|
||||
await updateDeviceConnectionMetric()
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user