Exemplo n.º 1
0
        public void Write()
        {
            if (OsInfo.IsWindows)
            {
                return;
            }

            var filename = Path.Combine(_appFolderInfo.AppDataFolder, "readarr.pid");

            try
            {
                File.WriteAllText(filename, _processProvider.GetCurrentProcessId().ToString());
            }
            catch (Exception ex)
            {
                _logger.Error(ex, "Unable to write PID file {0}", filename);
                throw new ReadarrStartupException(ex, "Unable to write PID file {0}", filename);
            }
        }
Exemplo n.º 2
0
        public void Write()
        {
            if (OsInfo.IsWindows)
            {
                return;
            }

            var filename = Path.Combine(_appFolderInfo.AppDataFolder, "nzbdrone.pid");

            try
            {
                File.WriteAllText(filename, _processProvider.GetCurrentProcessId().ToString());
            }
            catch (Exception ex)
            {
                _logger.Error("Unable to write PID file: " + filename, ex);
                throw;
            }
        }