/// <inheritdoc /> public async Task StopAsync(CancellationToken cancellationToken) { if (releaseServers && Running) { var reattachInformation = new WatchdogReattachInformation { AlphaIsActive = AlphaIsActive }; reattachInformation.Alpha = alphaServer?.Release(); reattachInformation.Bravo = bravoServer?.Release(); await reattachInfoHandler.Save(reattachInformation, cancellationToken).ConfigureAwait(false); } await Terminate(false, cancellationToken).ConfigureAwait(false); }
/// <inheritdoc /> public async Task StopAsync(CancellationToken cancellationToken) { try { if (releaseServers && Running) { await StopMonitor().ConfigureAwait(false); var reattachInformation = CreateReattachInformation(); await reattachInfoHandler.Save(reattachInformation, cancellationToken).ConfigureAwait(false); } await Terminate(false, cancellationToken).ConfigureAwait(false); } catch { releaseServers = false; throw; } }