public static IProgressItem Start(EntityType entityType, String CSVFileURI, String importSettingsJSON) { lock (_syncObj) { var operation = GetStatus(entityType); if (operation == null) { var fromCache = ImportDataCache.Get(entityType); if (fromCache != null) { return(fromCache); } } if (operation == null) { operation = new ImportDataOperation(entityType, CSVFileURI, importSettingsJSON); _importQueue.Add(operation); } if (!_importQueue.IsStarted) { _importQueue.Start(x => x.RunJob()); } return(operation); } }
public ImportFromCSV(TenantManager tenantProvider, DistributedTaskQueueOptionsManager progressQueueOptionsManager, ImportDataOperation importDataOperation) { _tenantId = tenantProvider.GetCurrentTenant().TenantId; _importQueue = progressQueueOptionsManager.Get <ImportDataOperation>(); _importDataOperation = importDataOperation; }
public object Clone() { var cloneObj = new ImportDataOperation(); cloneObj.Error = Error; cloneObj.Id = Id; cloneObj.IsCompleted = IsCompleted; cloneObj.Percentage = Percentage; cloneObj.Status = Status; return(cloneObj); }
public object Clone() { var cloneObj = new ImportDataOperation { Error = Error, Id = Id, IsCompleted = IsCompleted, Percentage = Percentage, Status = Status }; return(cloneObj); }
public object Clone() { var cloneObj = new ImportDataOperation { Error = Error, Id = Id, IsCompleted = IsCompleted, Percentage = Percentage, Status = Status }; return cloneObj; }
public static void Insert(EntityType entityType, ImportDataOperation data) { Cache.Insert(GetStateCacheKey(entityType), data, TimeSpan.FromMinutes(1)); }
public static IProgressItem Start(EntityType entityType, String CSVFileURI, String importSettingsJSON) { lock (_syncObj) { var operation = GetStatus(entityType); if (operation == null) { operation = new ImportDataOperation(entityType, CSVFileURI, importSettingsJSON); _importQueue.Add(operation); } if (!_importQueue.IsStarted) _importQueue.Start(x => x.RunJob()); return operation; } }
public object Clone() { var cloneObj = new ImportDataOperation(); cloneObj.Error = Error; cloneObj.Id = Id; cloneObj.IsCompleted = IsCompleted; cloneObj.Percentage = Percentage; cloneObj.Status = Status; return cloneObj; }