修复unbound日志未重定向

This commit is contained in:
ChsBuffer
2020-08-16 07:28:46 +08:00
parent bd5cf8b70d
commit d90a48577c
3 changed files with 4 additions and 3 deletions

View File

@@ -9,7 +9,7 @@ namespace Netch.Controllers
{
Name = "DNS Service";
MainFile = "unbound.exe";
RedirectStd = false;
// RedirectStd = false;
}
/// <summary>

View File

@@ -128,12 +128,13 @@ namespace Netch.Controllers
Instance.Start();
if (priority != ProcessPriorityClass.Normal)
Instance.PriorityClass = priority;
if (!RedirectStd || StartedKeywords.Count == 0) return true;
if (!RedirectStd) return true;
// 启动日志重定向
Instance.BeginOutputReadLine();
Instance.BeginErrorReadLine();
SaveBufferTimer.Elapsed += SaveBufferTimerEvent;
SaveBufferTimer.Enabled = true;
if (StartedKeywords.Count == 0) return true;
// 等待启动
for (var i = 0; i < 1000; i++)
{