mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-29 13:25:13 +02:00
Fixed: Fixed an issue where there could be a race condition during app update.
This commit is contained in:
@@ -57,6 +57,12 @@ namespace NzbDrone.Common
|
|||||||
return process;
|
return process;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public virtual void WaitForExit(Process process)
|
||||||
|
{
|
||||||
|
Logger.Trace("Waiting for process {0} to exit.", process.ProcessName);
|
||||||
|
process.WaitForExit();
|
||||||
|
}
|
||||||
|
|
||||||
public virtual void Kill(int processId)
|
public virtual void Kill(int processId)
|
||||||
{
|
{
|
||||||
if (processId == 0 || !Process.GetProcesses().Any(p => p.Id == processId))
|
if (processId == 0 || !Process.GetProcesses().Any(p => p.Id == processId))
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using FizzWare.NBuilder;
|
||||||
using FluentAssertions;
|
using FluentAssertions;
|
||||||
using Moq;
|
using Moq;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
|
@@ -86,8 +86,10 @@ namespace NzbDrone.Core.Jobs
|
|||||||
Arguments = string.Format("{0} {1}", _enviromentProvider.NzbDroneProcessIdFromEnviroment, _configFileProvider.Guid)
|
Arguments = string.Format("{0} {1}", _enviromentProvider.NzbDroneProcessIdFromEnviroment, _configFileProvider.Guid)
|
||||||
};
|
};
|
||||||
|
|
||||||
_processProvider.Start(startInfo);
|
var process = _processProvider.Start(startInfo);
|
||||||
notification.CurrentMessage = "Update in progress. NzbDrone will restart shortly.";
|
notification.CurrentMessage = "Update in progress. NzbDrone will restart shortly.";
|
||||||
|
|
||||||
|
_processProvider.WaitForExit(process);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Reference in New Issue
Block a user