Ancora update gestione envir da completare
This commit is contained in:
@@ -87,7 +87,7 @@ namespace EgwCoreLib.Lux.Data.Services
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Restituzione singolo Job specifico
|
||||
/// Restituzione singolo Job specifico dalla coda ORDINI
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
@@ -396,13 +396,10 @@ namespace EgwCoreLib.Lux.Data.Services
|
||||
/// </summary>
|
||||
/// <param name="hashKey">Chiave hash del contenuto richiesta RUID</param>
|
||||
/// <returns></returns>
|
||||
public async Task UpdateQueue(string hashKey)
|
||||
public async Task UpdateQueue(Constants.EXECENVIRONMENTS cEnvir, string hashKey)
|
||||
{
|
||||
// recupero info accessorie da redis
|
||||
var tipo = await _db.HashGetAsync(hashKey, "tipo");
|
||||
var envir = await _db.HashGetAsync(hashKey, "envir");
|
||||
Constants.EXECENVIRONMENTS cEnvir = Constants.EXECENVIRONMENTS.WINDOW;
|
||||
Enum.TryParse(envir, out cEnvir);
|
||||
|
||||
// verifico SE si tratta di un create/estimate e nel caso processo coda req x sistemare
|
||||
if (!tipo.IsNull && !string.IsNullOrEmpty(tipo))
|
||||
|
||||
@@ -97,13 +97,17 @@ namespace Lux.API.Controllers
|
||||
/// Chiamata GET:
|
||||
/// - fornisce il primo job da eseguire dalla coda (SE presente)
|
||||
/// - viene registrato come "in corso" e spostato dalla coda richiesta
|
||||
/// GET: api/Prod/getnext
|
||||
/// GET: api/Prod/getnext/WINDOW
|
||||
/// GET: api/Prod/getnext/BEAM
|
||||
/// </summary>
|
||||
/// <param name="envir">Environment della richiesta</param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("getnext")]
|
||||
public async Task<ActionResult<QuestionDTO>> GetNext()
|
||||
[HttpGet("getnext/{envir}")]
|
||||
public async Task<ActionResult<QuestionDTO>> GetNext(string envir)
|
||||
{
|
||||
var result = await PService.GetNext();
|
||||
Constants.EXECENVIRONMENTS cEnvir = Constants.EXECENVIRONMENTS.WINDOW;
|
||||
Enum.TryParse(envir, out cEnvir);
|
||||
var result = await PService.GetNext(cEnvir);
|
||||
QuestionDTO? deserRes = JsonConvert.DeserializeObject<QuestionDTO>(result);
|
||||
if (deserRes != null)
|
||||
{
|
||||
@@ -116,7 +120,9 @@ namespace Lux.API.Controllers
|
||||
deserRes.Args.Remove("RUID");
|
||||
}
|
||||
// lo aggiungo!
|
||||
string envir = $"{deserRes.ExecEnvironment}";
|
||||
#if false
|
||||
string envir = $"{deserRes.ExecEnvironment}";
|
||||
#endif
|
||||
var mode = deserRes.Args["Mode"];
|
||||
var sub = deserRes.Args["SubMode"];
|
||||
var uid = deserRes.Args["UID"];
|
||||
@@ -138,7 +144,6 @@ namespace Lux.API.Controllers
|
||||
/// <summary>
|
||||
/// Ritorno calcolo
|
||||
/// </summary>
|
||||
/// <param name="id">Chiave auth valida (da implementare)</param>
|
||||
/// <param name="retData"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("jobreturn")]
|
||||
@@ -189,16 +194,22 @@ namespace Lux.API.Controllers
|
||||
|
||||
/// <summary>
|
||||
/// Chiamata GET: num richieste in coda (se non specificato è waiting, altrimenti )
|
||||
/// GET: api/Prod/queue-len/
|
||||
/// GET: api/Prod/queue-len/waiting
|
||||
/// GET: api/Prod/queue-len/running
|
||||
/// GET: api/Prod/queue-len/WINDOW/
|
||||
/// GET: api/Prod/queue-len/WINDOW/waiting
|
||||
/// GET: api/Prod/queue-len/WINDOW/running
|
||||
/// GET: api/Prod/queue-len/BEAM/
|
||||
/// GET: api/Prod/queue-len/BEAM/waiting
|
||||
/// GET: api/Prod/queue-len/BEAM/running
|
||||
/// </summary>
|
||||
/// <param name="id">uid oggetto</param>
|
||||
/// <param name="envir">Environment della richiesta</param>
|
||||
/// <param name="type">Tipo coda (default waiting)</param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("qlen/{type}")]
|
||||
public async Task<IActionResult> QueueLen(QueueType type = QueueType.waiting)
|
||||
[HttpGet("qlen/{envir}/{type}")]
|
||||
public async Task<IActionResult> QueueLen(string envir, QueueType type = QueueType.waiting)
|
||||
{
|
||||
var result = await PService.QueueLen(type);
|
||||
Constants.EXECENVIRONMENTS cEnvir = Constants.EXECENVIRONMENTS.WINDOW;
|
||||
Enum.TryParse(envir, out cEnvir);
|
||||
var result = await PService.QueueLen(cEnvir, type);
|
||||
return Ok(result);
|
||||
}
|
||||
|
||||
@@ -206,16 +217,18 @@ namespace Lux.API.Controllers
|
||||
/// Chiamata GET: dizionario stato richieste
|
||||
/// GET: api/Prod/queue-status/
|
||||
/// </summary>
|
||||
/// <param name="id">uid oggetto</param>
|
||||
/// <param name="envir">Environment della richiesta</param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("qstatus")]
|
||||
public async Task<IActionResult> QueueStatus()
|
||||
public async Task<IActionResult> QueueStatus(string envir)
|
||||
{
|
||||
Stopwatch sw = new Stopwatch();
|
||||
sw.Start();
|
||||
Constants.EXECENVIRONMENTS cEnvir = Constants.EXECENVIRONMENTS.WINDOW;
|
||||
Enum.TryParse(envir, out cEnvir);
|
||||
Dictionary<string, long> queueStatus = new Dictionary<string, long>();
|
||||
long numWait = await PService.QueueLen(QueueType.waiting);
|
||||
long numRun = await PService.QueueLen(QueueType.running);
|
||||
long numWait = await PService.QueueLen(cEnvir, QueueType.waiting);
|
||||
long numRun = await PService.QueueLen(cEnvir, QueueType.running);
|
||||
// simulo status...
|
||||
queueStatus.Add("waiting", numWait);
|
||||
queueStatus.Add("running", numRun);
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Version>1.1.2602.0918</Version>
|
||||
<Version>1.1.2602.0919</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -127,7 +127,7 @@ namespace Lux.API.Services
|
||||
string hKey = await _calcRuidService.CompleteRequestAsync(RUID);
|
||||
|
||||
// verifico eventuali spostamenti code calcolo
|
||||
await _prodService.UpdateQueue(hKey);
|
||||
await _prodService.UpdateQueue(retData.ExecEnvironment, hKey);
|
||||
}
|
||||
|
||||
// gestione ritorno preview SVG
|
||||
@@ -216,7 +216,7 @@ namespace Lux.API.Services
|
||||
}
|
||||
// sistemo code, definendo nuova key...
|
||||
string qKey = $"{QuestionModes.ORDER}:{QuestionOrderSubModes.BALANCE}:{UID}.{refGroup}";
|
||||
await _prodService.SetDone(qKey, ProdService.QueueType.running);
|
||||
await _prodService.SetDone(retData.ExecEnvironment, qKey, ProdService.QueueType.running);
|
||||
// reinvio in redis (cache + channel)
|
||||
await cacheService.SaveProdBalanceAsync(UID, retData.ExecEnvironment, rawBalance);
|
||||
saved = true;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>LUX - Web Windows MES</i>
|
||||
<h4>Versione: 1.1.2602.0918</h4>
|
||||
<h4>Versione: 1.1.2602.0919</h4>
|
||||
<br /> Note di rilascio:
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -1 +1 @@
|
||||
1.1.2602.0918
|
||||
1.1.2602.0919
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>1.1.2602.0918</version>
|
||||
<version>1.1.2602.0919</version>
|
||||
<url>http://nexus.steamware.net/repository/SWS/GPW/stable/GPW.UI.zip</url>
|
||||
<changelog>http://nexus.steamware.net/repository/SWS/GPW/stable/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
Reference in New Issue
Block a user