Fix watcher breakage on failed builds (#347)
After switching to `async`/`await` the value of `isBuildCurrentlyRunning` wasn't correctly reset, which led to issues. By resetting the variable in `defer` we guarantee that it will be reset even when errors are thrown. Resolves #339.
This commit is contained in:
parent
c834751074
commit
53bc06c23d
|
@ -201,6 +201,8 @@ public actor Server {
|
|||
}
|
||||
|
||||
isBuildCurrentlyRunning = true
|
||||
defer { isBuildCurrentlyRunning = false }
|
||||
|
||||
// `configuration.builder` is guaranteed to be non-nil here as its presence is checked in `init`
|
||||
try await run(configuration.builder!, configuration.terminal)
|
||||
|
||||
|
@ -213,7 +215,6 @@ public actor Server {
|
|||
}
|
||||
|
||||
isSubsequentBuildScheduled = false
|
||||
isBuildCurrentlyRunning = false
|
||||
}
|
||||
|
||||
private func add(pendingChanges: [AbsolutePath]) {}
|
||||
|
|
|
@ -7,3 +7,4 @@ DerivedData/
|
|||
.swiftpm/config/registries.json
|
||||
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
|
||||
.netrc
|
||||
.vscode
|
||||
|
|
Loading…
Reference in New Issue