public void StartImport(ImportSetting importSetting) { var threads = GetThreads(); if (!threads.ContainsKey(importSetting.UUID)) { var service = new ImportService(); var process = new ImportProcessModel(importSetting.UUID, 1, 2, true); SetProcess(process); var importThread = new Thread(() => service.Import(importSetting)); importThread.Start(); threads.Add(importSetting.UUID, importThread); SetThreads(threads); } }
public void StartAllIntegrations() { var importSettingsService = new ImportSettingsService(); var importProcessService = new ImportProcessService(); var importSettings = importSettingsService.GetAll(); foreach (var importSetting in importSettings) { if (importSetting.Enabled && importSetting.RunOnApplicationStartup) importProcessService.StartImport(importSetting); } var importService = new ImportService(); var mainIntegrationThread = new Thread(importService.MainThread); mainIntegrationThread.Start(); }