Update file and folder handling methods from Radarr (#1051)

* Update file/folder handling methods from Radarr

* fixup!
This commit is contained in:
Qstick
2022-07-02 18:40:00 -05:00
committed by GitHub
parent cac2729230
commit 473405ceeb
17 changed files with 534 additions and 162 deletions
@@ -90,6 +90,12 @@ namespace NzbDrone.Update.UpdateEngine
Verify(installationFolder, processId);
if (installationFolder.EndsWith(@"\bin\Prowlarr") || installationFolder.EndsWith(@"/bin/Prowlarr"))
{
installationFolder = installationFolder.GetParentPath();
_logger.Info("Fixed Installation Folder: {0}", installationFolder);
}
var appType = _detectApplicationType.GetAppType();
_processProvider.FindProcessByName(ProcessProvider.PROWLARR_CONSOLE_PROCESS_NAME);
@@ -125,7 +131,7 @@ namespace NzbDrone.Update.UpdateEngine
// Set executable flag on app
if (OsInfo.IsOsx || (OsInfo.IsLinux && PlatformInfo.IsNetCore))
{
_diskProvider.SetPermissions(Path.Combine(installationFolder, "Prowlarr"), "0755");
_diskProvider.SetPermissions(Path.Combine(installationFolder, "Prowlarr"), "0755", null);
}
}
catch (Exception e)
@@ -146,7 +152,7 @@ namespace NzbDrone.Update.UpdateEngine
_terminateNzbDrone.Terminate(processId);
_logger.Info("Waiting for external auto-restart.");
for (int i = 0; i < 5; i++)
for (int i = 0; i < 10; i++)
{
System.Threading.Thread.Sleep(1000);