Пример #1
0
 /// <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);
 }
Пример #2
0
        /// <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;
            }
        }