protected override void OnStop() { log.Info("OnStop"); if (Scheduler != null) { Scheduler.Dispose(); Scheduler = null; } if (Database != null) { Database.Dispose(); Database = null; } }
protected override void OnStart(string[] args) { log.Info("OnStart"); try { Database = new Database.Database(); if (Configuration.DisableAPI) log.InfoFormat("API is disabled"); else API.API.ActivateApi(); Scheduler = new Scheduler(); } catch (Exception ex) { log.ErrorFormat("Exception during OnStart : {0}",ex); throw; } }