public void Start() { try { Logger.Debug($"Starting {Const.ServiceName}"); _state = QuarkServiceState.Running; Logger.Debug($"Service {Const.ServiceName} started, listening at:{_configuration.HostUrl}"); } catch (Exception e) { Logger.Error($"Error starting service:", e); } }
public void Stop() { try { Logger.Debug($"Stopping {Const.ServiceName} service"); Logger.Debug($"Service {Const.ServiceName} stopped"); } catch (Exception e) { Logger.Error("Error stopping service:", e); } finally { _state = QuarkServiceState.Stopped; } }
public void Start() { try { Logger.Debug($"Starting {Const.ServiceName}"); _webApiStartup = _appStartupFactory.Create(); _webApp = WebApp.Start(_configuration.HostUrl, builder => _webApiStartup.Configuration(builder)); _state = QuarkServiceState.Running; Logger.Debug($"Service {Const.ServiceName} started, listening at:{_configuration.HostUrl}"); } catch (Exception e) { Logger.Error($"Error starting service:", e); _webApp?.Dispose(); } }
public void Stop() { try { Logger.Debug($"Stopping {Const.ServiceName} service"); _webApp?.Dispose(); _appStartupFactory.Release(_webApiStartup); Logger.Debug($"Service {Const.ServiceName} stopped"); } catch (Exception e) { Logger.Error("Error stopping service:", e); } finally { _state = QuarkServiceState.Stopped; } }