private void LoadComponents() { foreach (var host in appConfig.hosts) { Hosts.Add(ComponentFactory.CreateHostComponent(appConfig, host)); } foreach (var comp in appConfig.components) { if (comp is ForgeComponentType) { Forges.Add(ComponentFactory.CreateForgeComponent(appConfig, comp as ForgeComponentType)); } else if (comp is DgidxComponentType) { dgidx = ComponentFactory.CreateDgidxComponent(appConfig, comp as DgidxComponentType); } else if (comp is DgraphComponentType) { Dgraphs.Add(ComponentFactory.CreateDgraphComponent(appConfig, comp as DgraphComponentType)); } else if (comp is LogServerComponentType) { logServer = ComponentFactory.CreateLogServerComponent(appConfig, comp as LogServerComponentType); } } }
private static void RunDgidx(DgidxComponent dgidx) { // backup old index (this will automatically clear dgidx output folder) Logger.Info("Archiving Previous Index ..."); if (!dgidx.ArchiveIndex()) { Logger.Warn("Index backup failed!"); } Logger.Info("Indexing..."); dgidx.ArchiveLog(true); dgidx.Run(); if (dgidx.IsFailed) { throw new ControlScriptException(dgidx.FailureMessage); } }