diff options
author | sr55 <[email protected]> | 2020-12-03 20:24:08 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2020-12-03 20:24:08 +0000 |
commit | e0038b2e9008782ea2610dcf1de4e5ef5a727b58 (patch) | |
tree | 11f9c98b71e778e3ecf2093608f55f3af455293d /win/CS/HandBrakeWPF/Instance | |
parent | 3b0bd7689579fb8012a3a6c00eae53243c61d8bd (diff) |
WinGui: Improved reliablity of the queue service with multiple instances running. Note, there will now be up to a 3.5 second delay before starting each new job.
Diffstat (limited to 'win/CS/HandBrakeWPF/Instance')
-rw-r--r-- | win/CS/HandBrakeWPF/Instance/RemoteInstance.cs | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/win/CS/HandBrakeWPF/Instance/RemoteInstance.cs b/win/CS/HandBrakeWPF/Instance/RemoteInstance.cs index aefed4198..86af2aec9 100644 --- a/win/CS/HandBrakeWPF/Instance/RemoteInstance.cs +++ b/win/CS/HandBrakeWPF/Instance/RemoteInstance.cs @@ -63,17 +63,23 @@ namespace HandBrakeWPF.Instance public async void PauseEncode() { - await this.MakeHttpGetRequest("PauseEncode"); - this.StopPollingProgress(); + if (this.IsServerRunning()) + { + await this.MakeHttpGetRequest("PauseEncode"); + this.StopPollingProgress(); + } } public async void ResumeEncode() { - await this.MakeHttpGetRequest("ResumeEncode"); - this.MonitorEncodeProgress(); + if (this.IsServerRunning()) + { + await this.MakeHttpGetRequest("ResumeEncode"); + this.MonitorEncodeProgress(); + } } - public void StartEncode(JsonEncodeObject jobToStart) + public async void StartEncode(JsonEncodeObject jobToStart) { if (this.IsServerRunning()) { @@ -88,7 +94,10 @@ namespace HandBrakeWPF.Instance public async void StopEncode() { - await this.MakeHttpGetRequest("StopEncode"); + if (this.IsServerRunning()) + { + await this.MakeHttpGetRequest("StopEncode"); + } } public JsonState GetEncodeProgress() |