CA-192640: Don't log exceptions when HealthCheck service is not installed (part 2)

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
This commit is contained in:
Rob Hoes 2016-01-20 14:47:39 +00:00
parent a887faa5f1
commit 1de9f35566

View File

@ -1,4 +1,4 @@
/* Copyright (c) Citrix Systems Inc. /* Copyright (c) Citrix Systems Inc.
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, * Redistribution and use in source and binary forms,
@ -71,8 +71,15 @@ namespace XenAdmin.Actions
protected override void Run() protected override void Run()
{ {
ServiceController sc = new ServiceController(HEALTHCHECKSERVICENAME); ServiceController sc = new ServiceController(HEALTHCHECKSERVICENAME);
try
{
if (sc.Status != ServiceControllerStatus.Running) if (sc.Status != ServiceControllerStatus.Running)
return; return;
}
catch
{
return;
}
NamedPipeClientStream pipeClient = new NamedPipeClientStream(".", HealthCheckSettings.HEALTH_CHECK_PIPE, PipeDirection.Out); NamedPipeClientStream pipeClient = new NamedPipeClientStream(".", HealthCheckSettings.HEALTH_CHECK_PIPE, PipeDirection.Out);
int retryCount = 120; int retryCount = 120;