Connect to several servers, one coloured window each
This commit is contained in:
@@ -20,12 +20,12 @@ private enum SnapshotPatches {
|
||||
static var patches: [String: Task<String?, any Error>] = [:]
|
||||
|
||||
static func patch(_ api: API, _ taskId: String, _ n: Int, _ path: String) async throws -> String? {
|
||||
let key = "\(taskId)/\(n)/\(path)"
|
||||
let key = "\(api.origin.absoluteString)/\(taskId)/\(n)/\(path)"
|
||||
if let cached = patches[key] {
|
||||
return try await cached.value
|
||||
}
|
||||
let fetched = Task<String?, any Error> {
|
||||
let ck = "\(taskId)/\(n)"
|
||||
let ck = "\(api.origin.absoluteString)/\(taskId)/\(n)"
|
||||
let pending = changes[ck] ?? Task {
|
||||
try await api.client.getTaskChanges(path: .init(taskId: taskId), query: .init(snapshot: n)).ok.body.json
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user