Naming fix
This commit is contained in:
@@ -829,7 +829,7 @@ public class LayersController : Controller
|
||||
x.Records!.Any(y => y.Code == "Type" && y.Desc1 == "ImportWorker") &&
|
||||
x.Records!.Any(y => y.Code == "IsEnabled" && y.Desc1 == "True") &&
|
||||
!x.IsDeleted && !x.IsCancelled
|
||||
);
|
||||
).Take(5);
|
||||
|
||||
// If specific layerId is provided, filter to that layer only
|
||||
if (layerId.HasValue)
|
||||
@@ -935,7 +935,7 @@ public class LayersController : Controller
|
||||
x.Records!.Any(y => y.Code == "Type" && y.Desc1 == "ProcessWorker") &&
|
||||
x.Records!.Any(y => y.Code == "IsEnabled" && y.Desc1 == "True") &&
|
||||
!x.IsDeleted && !x.IsCancelled
|
||||
);
|
||||
).Take(5);
|
||||
|
||||
// If specific layerId is provided, filter to that layer only
|
||||
if (layerId.HasValue)
|
||||
@@ -966,6 +966,7 @@ public class LayersController : Controller
|
||||
|
||||
foreach (var processWorker in processWorkerLayers)
|
||||
{
|
||||
// POPRAWIONE: Używaj Plugin zamiast ProcessorType
|
||||
var pluginName = processWorker.Records!.FirstOrDefault(x => x.Code == "Plugin")?.Desc1;
|
||||
if (string.IsNullOrEmpty(pluginName))
|
||||
{
|
||||
@@ -974,20 +975,12 @@ public class LayersController : Controller
|
||||
continue;
|
||||
}
|
||||
|
||||
var processorType = processWorker.Records!.FirstOrDefault(x => x.Code == "ProcessorType")?.Desc1;
|
||||
if (string.IsNullOrEmpty(processorType))
|
||||
{
|
||||
_logger.LogWarning("EnqueueProcessWorkers: No processor type found for layer {LayerName} ({LayerId}), skipping",
|
||||
processWorker.Name, processWorker.Id);
|
||||
continue;
|
||||
}
|
||||
|
||||
// Check if processor exists
|
||||
var processor = _pluginManager.GetProcessor(processorType);
|
||||
// POPRAWIONE: Sprawdź czy processor istnieje przez pluginName
|
||||
var processor = _pluginManager.GetProcessor(pluginName);
|
||||
if (processor == null)
|
||||
{
|
||||
_logger.LogWarning("EnqueueProcessWorkers: Processor {ProcessorType} not found for layer {LayerName} ({LayerId}), skipping",
|
||||
processorType, processWorker.Name, processWorker.Id);
|
||||
_logger.LogWarning("EnqueueProcessWorkers: Processor {PluginName} not found for layer {LayerName} ({LayerId}), skipping",
|
||||
pluginName, processWorker.Name, processWorker.Id);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1003,7 +996,7 @@ public class LayersController : Controller
|
||||
{
|
||||
LayerId = processWorker.Id,
|
||||
LayerName = processWorker.Name ?? "Unknown",
|
||||
PluginName = processorType, // Use processorType as PluginName for process jobs
|
||||
PluginName = pluginName, // POPRAWIONE: Używaj pluginName bezpośrednio
|
||||
JobType = JobType.Process,
|
||||
Priority = priority,
|
||||
MaxRetries = 3,
|
||||
@@ -1014,8 +1007,8 @@ public class LayersController : Controller
|
||||
await _queueService.EnqueueJobAsync(job);
|
||||
queuedCount++;
|
||||
|
||||
_logger.LogDebug("EnqueueProcessWorkers: Queued process job for layer {LayerName} ({LayerId}) with processor {ProcessorType}, priority {Priority}",
|
||||
processWorker.Name, processWorker.Id, processorType, priority);
|
||||
_logger.LogDebug("EnqueueProcessWorkers: Queued process job for layer {LayerName} ({LayerId}) with plugin {PluginName}, priority {Priority}",
|
||||
processWorker.Name, processWorker.Id, pluginName, priority);
|
||||
}
|
||||
|
||||
var totalQueueSize = await _queueService.GetQueueCountAsync();
|
||||
@@ -1065,8 +1058,16 @@ public class LayersController : Controller
|
||||
|
||||
_logger.LogInformation("RunQueueJobs: Triggering queue processing for {QueueSize} jobs", queueSize);
|
||||
|
||||
// PRZYWRÓĆ SINGLETON ACCESS:
|
||||
var queueProcessor = HttpContext.RequestServices.GetRequiredService<JobQueueProcessor>();
|
||||
// ZMIEŃ NA DOSTĘP PRZEZ IHostedService:
|
||||
var hostedServices = HttpContext.RequestServices.GetServices<IHostedService>();
|
||||
var queueProcessor = hostedServices.OfType<JobQueueProcessor>().FirstOrDefault();
|
||||
|
||||
if (queueProcessor == null)
|
||||
{
|
||||
_logger.LogError("RunQueueJobs: JobQueueProcessor not found");
|
||||
return BadRequest("JobQueueProcessor not found");
|
||||
}
|
||||
|
||||
queueProcessor.TriggerProcessing();
|
||||
|
||||
return Ok(new
|
||||
|
||||
Reference in New Issue
Block a user