Ejemplo n.º 1
0
 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);
     }
 }
Ejemplo n.º 2
0
 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;
     }
 }
Ejemplo n.º 3
0
 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();
     }
 }
Ejemplo n.º 4
0
 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;
     }
 }