Split import into sources
This commit is contained in:
@@ -185,7 +185,7 @@ public class LayersController : Controller
|
||||
[HttpGet]
|
||||
[Route("AutoImportWithQueue/{apiKey}")]
|
||||
[AllowAnonymous]
|
||||
public async Task<IActionResult> AutoImportWithQueue(string apiKey)
|
||||
public IActionResult AutoImportWithQueue(string apiKey)
|
||||
{
|
||||
if (Request.Host.Value != _configuration["apiLocalUrl"] || apiKey != _configuration["apiKey"])
|
||||
{
|
||||
@@ -243,7 +243,7 @@ public class LayersController : Controller
|
||||
[HttpGet]
|
||||
[Route("ProcessQueue/{apiKey}")]
|
||||
[AllowAnonymous]
|
||||
public async Task<IActionResult> ProcessQueue(string apiKey)
|
||||
public IActionResult ProcessQueue(string apiKey)
|
||||
{
|
||||
/*
|
||||
var allJobs = await _queue.GetJobs();
|
||||
@@ -260,9 +260,9 @@ public class LayersController : Controller
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
[Route("AutoImport/{apiKey}")]
|
||||
[Route("AutoImport/{apiKey}/{nameFilter}")]
|
||||
[AllowAnonymous]
|
||||
public IActionResult AutoImport(string apiKey)
|
||||
public IActionResult AutoImport(string apiKey, string nameFilter)
|
||||
{
|
||||
if (Request.Host.Value != _configuration["apiLocalUrl"] || apiKey != _configuration["apiKey"])
|
||||
{
|
||||
@@ -277,11 +277,19 @@ public class LayersController : Controller
|
||||
var importWorkerLayers = _db.Layers
|
||||
.Include(x => x.Records)
|
||||
.Where(x =>
|
||||
x.Name != null && x.Name.Contains(nameFilter) &&
|
||||
x.Records!.Any(y => y.Code == "Type" && y.Desc1 == "ImportWorker") &&
|
||||
x.Records!.Any(y => y.Code == "IsEnabled" && y.Desc1 == "True")
|
||||
)
|
||||
.OrderBy(x => x.CreatedAt)
|
||||
.OrderByDescending(x => x.CreatedAt)
|
||||
.ToList();
|
||||
_logsController.AddEntry(new LogEntry
|
||||
{
|
||||
Title = $"Starting import: {nameFilter}, Admin layers count ({importWorkerLayers.Count})",
|
||||
Type = LogEntryType.Info,
|
||||
LogType = LogType.Import,
|
||||
CreatedAt = DateTime.UtcNow
|
||||
});
|
||||
try
|
||||
{
|
||||
if (importWorkerLayers.Count == 0)
|
||||
@@ -302,7 +310,6 @@ public class LayersController : Controller
|
||||
{
|
||||
var type = importWorker.Records!.FirstOrDefault(x => x.Code == "ImportType")?.Desc1 ??
|
||||
"Standard";
|
||||
var name = importWorker.Name;
|
||||
switch (type)
|
||||
{
|
||||
case "D1":
|
||||
|
||||
Reference in New Issue
Block a user