public async Task StopAsync(CancellationToken cancellationToken) { logger.LogDebug("Stopping service... "); try { source.Cancel(); source.Dispose(); await adapter.Stop(cancellationToken); } catch (Exception e) { logger.LogError(e, "Failed to stop service!"); throw; } logger.LogInformation("Service stopped."); }
public async Task Stop() { await adapter.Stop(); }