Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8a1a200

Browse files
committed
set generous timeouts on session requests
1 parent027cd7a commit8a1a200

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

‎Coder-Desktop/VPNLib/FileSync/FileSyncDaemon.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ public class MutagenDaemon: FileSyncDaemon {
4343
privateletmutagenDataDirectory:URL
4444
privateletmutagenDaemonSocket:URL
4545

46+
// Managing sync sessions can take a while, especially with prompting
47+
letsessionMgmtReqTimeout:TimeAmount=.seconds(5)
48+
4649
// Non-nil when the daemon is running
4750
varclient:DaemonClient?
4851
privatevargroup:MultiThreadedEventLoopGroup?

‎Coder-Desktop/VPNLib/FileSync/FileSyncManagement.swift

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import NIOCore
2+
13
publicextensionMutagenDaemon{
24
func refreshSessions()async{
35
guard case.running= stateelse{return}
@@ -49,7 +51,7 @@ public extension MutagenDaemon {
4951
}
5052
}
5153
do{
52-
_=tryawait client!.sync.create(req)
54+
_=tryawait client!.sync.create(req, callOptions:.init(timeLimit:.timeout(sessionMgmtReqTimeout)))
5355
}catch{
5456
throw.grpcFailure(error)
5557
}
@@ -68,7 +70,7 @@ public extension MutagenDaemon {
6870
req.selection=.with{ selectionin
6971
selection.specifications= ids
7072
}
71-
})
73+
}, callOptions:.init(timeLimit:.timeout(sessionMgmtReqTimeout)))
7274
}catch{
7375
throw.grpcFailure(error)
7476
}
@@ -87,7 +89,7 @@ public extension MutagenDaemon {
8789
req.selection=.with{ selectionin
8890
selection.specifications= ids
8991
}
90-
})
92+
}, callOptions:.init(timeLimit:.timeout(sessionMgmtReqTimeout)))
9193
}catch{
9294
throw.grpcFailure(error)
9395
}
@@ -106,7 +108,7 @@ public extension MutagenDaemon {
106108
req.selection=.with{ selectionin
107109
selection.specifications= ids
108110
}
109-
})
111+
}, callOptions:.init(timeLimit:.timeout(sessionMgmtReqTimeout)))
110112
}catch{
111113
throw.grpcFailure(error)
112114
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp