This commit is contained in:
zaccaria.majid
2023-05-12 09:00:20 +02:00
13 changed files with 473 additions and 121 deletions
+92 -92
View File
@@ -132,98 +132,98 @@ WDC.UI:staging:
- dotnet build $env:APP_NAME/$env:APP_NAME.csproj
- dotnet publish -p:PublishProfile=IIS01.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=$IIS_PWD -p:AllowUntrustedCertificate=true -p:verbosity=quiet $env:APP_NAME/$env:APP_NAME.csproj
# # ---------- DEPLOY ----------
# WDC.Api:deploy:
# stage: deploy
# tags:
# - win
# environment:
# name: production
# url: https://seriate.egalware.com/GPW/WDC.UI
# variables:
# APP_NAME: WebDoorCreator.API
# SOL_NAME: WebDoorCreator.UI
# only:
# - main
# needs: ["WDC.Api:build"]
# before_script:
# - *nuget-fix
# - dotnet restore "$env:SOL_NAME.sln"
# script:
# - dotnet build $env:APP_NAME/$env:APP_NAME.csproj
# # # IIS 02
# # - dotnet publish -p:PublishProfile=IIS02.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=$IIS_PWD -p:AllowUntrustedCertificate=true -p:verbosity=quiet $env:APP_NAME/$env:APP_NAME.csproj
# # IIS PROD
# - dotnet publish -p:PublishProfile=IIS-PROD.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=$IIS_PWD -p:AllowUntrustedCertificate=true -p:verbosity=quiet $env:APP_NAME/$env:APP_NAME.csproj
# ---------- DEPLOY ----------
WDC.Api:deploy:
stage: deploy
tags:
- win
environment:
name: production
url: https://seriate.egalware.com/GPW/WDC.UI
variables:
APP_NAME: WebDoorCreator.API
SOL_NAME: WebDoorCreator.UI
only:
- main
needs: ["WDC.Api:build"]
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
script:
- dotnet build $env:APP_NAME/$env:APP_NAME.csproj
# IIS 02
- dotnet publish -p:PublishProfile=IIS02.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=$IIS_PWD -p:AllowUntrustedCertificate=true -p:verbosity=quiet $env:APP_NAME/$env:APP_NAME.csproj
# IIS PROD
- dotnet publish -p:PublishProfile=IIS-PROD.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=$IIS_PWD -p:AllowUntrustedCertificate=true -p:verbosity=quiet $env:APP_NAME/$env:APP_NAME.csproj
# WDC.UI:deploy:
# stage: deploy
# tags:
# - win
# variables:
# APP_NAME: WebDoorCreator.UI
# SOL_NAME: WebDoorCreator.UI
# only:
# - main
# needs: ["WDC.UI:build"]
# before_script:
# - *nuget-fix
# - dotnet restore "$env:SOL_NAME.sln"
# script:
# - dotnet build $env:APP_NAME/$env:APP_NAME.csproj
# # IIS EXT
# - dotnet publish -p:PublishProfile=IIS-EXT.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=$IIS_PWD -p:AllowUntrustedCertificate=true -p:verbosity=quiet $env:APP_NAME/$env:APP_NAME.csproj
# # IIS INT
# - dotnet publish -p:PublishProfile=IIS-INT.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=$IIS_PWD -p:AllowUntrustedCertificate=true -p:verbosity=quiet $env:APP_NAME/$env:APP_NAME.csproj
WDC.UI:deploy:
stage: deploy
tags:
- win
variables:
APP_NAME: WebDoorCreator.UI
SOL_NAME: WebDoorCreator.UI
only:
- main
needs: ["WDC.UI:build"]
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
script:
- dotnet build $env:APP_NAME/$env:APP_NAME.csproj
# IIS EXT
- dotnet publish -p:PublishProfile=IIS02.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=$IIS_PWD -p:AllowUntrustedCertificate=true -p:verbosity=quiet $env:APP_NAME/$env:APP_NAME.csproj
# IIS INT
- dotnet publish -p:PublishProfile=IIS-PROD.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=$IIS_PWD -p:AllowUntrustedCertificate=true -p:verbosity=quiet $env:APP_NAME/$env:APP_NAME.csproj
# # ---------- RELEASE ----------
# WDC.Api:release:
# stage: release
# tags:
# - win
# variables:
# APP_NAME: WebDoorCreator.API
# SOL_NAME: WebDoorCreator.UI
# only:
# - main
# except:
# - branches
# needs: ["WDC.Api:build"]
# before_script:
# - *nuget-fix
# - dotnet restore "$env:SOL_NAME.sln"
# artifacts:
# paths:
# - publish/
# script:
# - dotnet build $env:APP_NAME/$env:APP_NAME.csproj
# - dotnet publish -p:PublishProfile=IISProfile.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release $env:APP_NAME/$env:APP_NAME.csproj -o:publish -p:verbosity=quiet
# # qui il deploy su nexus...
# - *hashBuild
# - *nexusUpload
# # script:
# # - dotnet publish -c Release -o ./publish GPW.WDC.Api/GPW.WDC.Api.csproj
# ---------- RELEASE ----------
WDC.Api:release:
stage: release
tags:
- win
variables:
APP_NAME: WebDoorCreator.API
SOL_NAME: WebDoorCreator.UI
only:
- main
except:
- branches
needs: ["WDC.Api:build"]
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
artifacts:
paths:
- publish/
script:
- dotnet build $env:APP_NAME/$env:APP_NAME.csproj
- dotnet publish -p:PublishProfile=IISProfile.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release $env:APP_NAME/$env:APP_NAME.csproj -o:publish -p:verbosity=quiet
# qui il deploy su nexus...
- *hashBuild
- *nexusUpload
# script:
# - dotnet publish -c Release -o ./publish GPW.WDC.Api/GPW.WDC.Api.csproj
# WDC.UI:release:
# stage: release
# tags:
# - win
# variables:
# APP_NAME: WebDoorCreator.UI
# SOL_NAME: WebDoorCreator.UI
# only:
# - main
# except:
# - branches
# needs: ["WDC.UI:build"]
# artifacts:
# paths:
# - publish/
# script:
# - dotnet build $env:APP_NAME/$env:APP_NAME.csproj
# - dotnet publish -p:PublishProfile=IISProfile.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release $env:APP_NAME/$env:APP_NAME.csproj -o:publish -p:verbosity=quiet
# # qui il deploy su nexus...
# - *hashBuild
# - *nexusUpload
# # script:
# # - dotnet publish -c Release -o ./publish GPW.CORE.WRKLOG/GPW.CORE.WRKLOG.csproj
WDC.UI:release:
stage: release
tags:
- win
variables:
APP_NAME: WebDoorCreator.UI
SOL_NAME: WebDoorCreator.UI
only:
- main
except:
- branches
needs: ["WDC.UI:build"]
artifacts:
paths:
- publish/
script:
- dotnet build $env:APP_NAME/$env:APP_NAME.csproj
- dotnet publish -p:PublishProfile=IISProfile.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release $env:APP_NAME/$env:APP_NAME.csproj -o:publish -p:verbosity=quiet
# qui il deploy su nexus...
- *hashBuild
- *nexusUpload
# script:
# - dotnet publish -c Release -o ./publish GPW.CORE.WRKLOG/GPW.CORE.WRKLOG.csproj
+157 -13
View File
@@ -27,6 +27,9 @@ Public Class Form1
m_MaxCamInstances = value
End Sub
Dim m_ExecutionThread As Thread
Dim m_bExecutionThreadStoped As Boolean = False
Private Sub btnTestPing_Click(sender As Object, e As EventArgs) Handles btnTestPing.Click
' chiamo test ping...
risultatoPing = currWDC.testPing
@@ -46,6 +49,10 @@ Public Class Form1
Private Sub StopProcess_Click(sender As Object, e As EventArgs) Handles StopProcess.Click
m_bStopProcess = True
While Not m_bExecutionThreadStoped
Thread.Sleep(10)
End While
m_ExecutionThread = Nothing
End Sub
Private Structure MyProc
@@ -64,6 +71,7 @@ Public Class Form1
While Not m_bStopProcess
' se c'e' qualcosa da processare
If currWDC.numTask2proc > 0 Then
@@ -128,13 +136,158 @@ Public Class Form1
End Sub
Private Sub StartProcess_Click(sender As Object, e As EventArgs) Handles StartProcess.Click
Private Sub ExecutionProcess()
' recupero Id dei DDF
Dim sDdfRoot As String = "c:\EgtData\WebDoor\Ddf"
Dim sCurrDdfDir As String = ""
Dim nDdfId As Integer = 1
' Numero di core logici da utilizzare (minimo tra presenti sul PC e imposti da INI)
Dim nMaxThread As Integer = Math.Min(Environment.ProcessorCount, m_MaxCamInstances)
Dim bStopMainProcess As Boolean = False
Dim n30SecCounter As Integer = 0
While Not bStopMainProcess
bStopMainProcess = m_bStopProcess
Dim bOk As Boolean = False
While Not bOk
' ogni 30 secondi
If n30SecCounter = 30 OrElse n30SecCounter = 0 Then
' verifica connessione
Dim risultatoPing As PingReply = currWDC.testPing
bOk = risultatoPing.Status = IPStatus.Success
If bOk Then
bOk = currWDC.testAlive
End If
Else bOk = True
End If
' se connessione non ok o processo fermato, fermo i thread
If Not bOk OrElse bStopMainProcess Then
If Not IsNothing(ThreadList) AndAlso ThreadList.Count > 0 AndAlso Not IsNothing(ThreadList(0)) Then
' li fermo
m_bStopProcess = True
' verifico siano terminati
Dim bOneNotEnded As Boolean = True
While bOneNotEnded
bOneNotEnded = False
For Each Thread In ThreadList
If Thread.IsAlive Then
bOneNotEnded = True
End If
Next
End While
' pulisco la lista
For ThreadIndex = 0 To ThreadList.Count - 1
ThreadList(ThreadIndex) = Nothing
Next
End If
If bStopMainProcess Then
m_bExecutionThreadStoped = True
Return
End If
End If
If Not bOk Then Thread.Sleep(10)
End While
If bOk AndAlso (IsNothing(ThreadList) OrElse ThreadList.Count = 0 OrElse IsNothing(ThreadList(0))) Then
ThreadList = New Thread(nMaxThread - 1) {}
For nThreadIndex = 0 To nMaxThread - 1
ThreadList(nThreadIndex) = New Thread(Sub()
ThreadFunction()
End Sub)
ThreadList(nThreadIndex).SetApartmentState(ApartmentState.STA)
' avvio thread di gestione della macchina che avvia la connessione
ThreadList(nThreadIndex).Start()
Thread.Sleep(10)
Next
End If
If n30SecCounter <= 30 Then
n30SecCounter += 1
Else
n30SecCounter = 1
End If
Thread.Sleep(1000)
End While
End Sub
Private Sub StartProcess_Click(sender As Object, e As EventArgs) Handles StartProcess.Click
m_bStopProcess = False
m_ExecutionThread = New Thread(Sub()
ExecutionProcess()
End Sub)
m_ExecutionThread.SetApartmentState(ApartmentState.STA)
' avvio thread di gestione della macchina che avvia la connessione
m_ExecutionThread.Start()
'' recupero Id dei DDF
'Dim sDdfRoot As String = "c:\EgtData\WebDoor\Ddf"
'Dim sCurrDdfDir As String = ""
'Dim nDdfId As Integer = 1
'' Numero di core logici da utilizzare (minimo tra presenti sul PC e imposti da INI)
'Dim nMaxThread As Integer = Math.Min(Environment.ProcessorCount, m_MaxCamInstances)
'Dim bStopMainProcess As Boolean = False
'Dim n30SecCounter As Integer = 0
'While Not bStopMainProcess
' bStopMainProcess = m_bStopProcess
' Dim bOk As Boolean = False
' While Not bOk
' ' ogni 30 secondi
' If n30SecCounter = 30 OrElse n30SecCounter = 0 Then
' ' verifica connessione
' Dim risultatoPing As PingReply = currWDC.testPing
' bOk = risultatoPing.Status = IPStatus.Success
' If bOk Then
' bOk = currWDC.testAlive
' End If
' Else bOk = True
' End If
' ' se connessione non ok o processo fermato, fermo i thread
' If Not bOk OrElse bStopMainProcess Then
' If Not IsNothing(ThreadList) AndAlso ThreadList.Count > 0 Then
' ' li fermo
' m_bStopProcess = True
' ' verifico siano terminati
' Dim bOneNotEnded As Boolean = True
' While bOneNotEnded
' bOneNotEnded = False
' For Each Thread In ThreadList
' If Thread.IsAlive Then
' bOneNotEnded = True
' Exit For
' End If
' Next
' End While
' ' pulisco la lista
' For Each Thread In ThreadList
' Thread = Nothing
' Next
' End If
' If bStopMainProcess Then Return
' End If
' If Not bOk Then Thread.Sleep(10)
' End While
' If bOk AndAlso (IsNothing(ThreadList) OrElse ThreadList.Count = 0) Then
' ThreadList = New Thread(nMaxThread - 1) {}
' For nThreadIndex = 0 To nMaxThread - 1
' ThreadList(nThreadIndex) = New Thread(Sub()
' ThreadFunction()
' End Sub)
' ThreadList(nThreadIndex).SetApartmentState(ApartmentState.STA)
' ' avvio thread di gestione della macchina che avvia la connessione
' ThreadList(nThreadIndex).Start()
' Next
' End If
' If n30SecCounter <= 30 Then
' n30SecCounter += 1
' Else
' n30SecCounter = 1
' End If
' Thread.Sleep(1000)
'End While
'Dim DdfDirs As String() = Directory.GetDirectories(sDdfRoot)
'If DdfDirs.Count = 0 Then
' sCurrDdfDir = sDdfRoot & "\0"
@@ -157,17 +310,8 @@ Public Class Form1
' End If
'End If
' Numero di core logici da utilizzare (minimo tra presenti sul PC e imposti da INI)
Dim nMaxThread As Integer = Math.Min(Environment.ProcessorCount, m_MaxCamInstances)
ThreadList = New Thread(nMaxThread - 1) {}
For nThreadIndex = 0 To nMaxThread - 1
ThreadList(nThreadIndex) = New Thread(Sub()
ThreadFunction()
End Sub)
ThreadList(nThreadIndex).SetApartmentState(ApartmentState.STA)
' avvio thread di gestione della macchina che avvia la connessione
ThreadList(nThreadIndex).Start()
Next
' ' Lancio in parallelo più processi (senza superare il numero di core logici presenti)
' Dim vProc As MyProc() = New MyProc(nMaxThread - 1) {}
@@ -84,6 +84,10 @@ namespace WebDoorCreator.API.Controllers
var actProc = await QDataServ.RequestProcessing();
answ.Add("processing", actProc);
var actDone = await QDataServ.RequestDone();
answ.Add("done", actProc);
return answ;
}
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<WebPublishMethod>MSDeploy</WebPublishMethod>
<LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish>https://iis04.egalware.com/WDC/SRV/swagger/index.html</SiteUrlToLaunchAfterPublish>
<ExcludeApp_Data>false</ExcludeApp_Data>
<ProjectGuid>c2109e71-4eae-4167-9052-175123ccc2bc</ProjectGuid>
<SelfContained>false</SelfContained>
<MSDeployServiceURL>https://iis04.egalware.com:8172/MsDeploy.axd</MSDeployServiceURL>
<DeployIisAppPath>Default Web Site/WDC/SRV</DeployIisAppPath>
<RemoteSitePhysicalPath />
<SkipExtraFilesOnServer>false</SkipExtraFilesOnServer>
<MSDeployPublishMethod>WMSVC</MSDeployPublishMethod>
<EnableMSDeployBackup>true</EnableMSDeployBackup>
<EnableMsDeployAppOffline>true</EnableMsDeployAppOffline>
<UserName>jenkins</UserName>
<_SavePWD>true</_SavePWD>
<_TargetId>IISWebDeploy</_TargetId>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
</Project>
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is used by the publish/package process of your Web project. You can customize the behavior of this process
by editing this MSBuild file. In order to learn more about this please visit https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<TimeStampOfAssociatedLegacyPublishXmlFile />
<EncryptedPassword>AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAk75miMJLMkCTEelQutKpbwAAAAACAAAAAAADZgAAwAAAABAAAAB43BVhUmznhAu3pUfV1IfOAAAAAASAAACgAAAAEAAAAEV8hgbujDFfsMjS77NS2oYYAAAAUHPGFaVWgRqQPDU4wk5KGABmVHKko4/9FAAAANtaROBOcPHljx4RnmQHj5aHdtYk</EncryptedPassword>
<History>True|2023-05-11T15:35:09.5858697Z;True|2022-01-27T10:34:09.2346456+01:00;True|2022-01-27T10:13:36.3080675+01:00;True|2022-01-27T10:05:45.6649507+01:00;True|2022-01-26T14:34:16.5263189+01:00;True|2022-01-26T13:04:22.2336648+01:00;False|2022-01-26T13:04:06.0677616+01:00;True|2021-11-08T09:03:37.7855257+01:00;True|2021-11-08T09:03:34.8263479+01:00;True|2021-11-08T09:03:31.8889390+01:00;True|2021-10-29T16:19:33.6539408+02:00;True|2021-10-29T16:19:28.2082360+02:00;True|2021-10-26T16:12:11.7740950+02:00;True|2021-10-26T16:11:56.2014641+02:00;True|2021-10-26T16:11:22.2897842+02:00;False|2021-10-26T16:10:58.3733037+02:00;False|2021-10-26T16:10:29.4793991+02:00;True|2021-10-21T17:35:11.9761128+02:00;True|2021-10-18T20:22:00.9305399+02:00;True|2021-10-18T18:32:29.4558070+02:00;True|2021-10-18T18:32:22.8950294+02:00;True|2021-10-18T18:16:13.7563877+02:00;True|2021-10-18T18:15:48.5678387+02:00;True|2021-10-18T12:45:45.7228681+02:00;True|2021-10-18T12:14:22.3221605+02:00;True|2021-10-18T12:14:15.7373530+02:00;True|2021-10-18T12:10:43.8607301+02:00;</History>
<LastFailureDetails />
</PropertyGroup>
</Project>
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<WebPublishMethod>MSDeploy</WebPublishMethod>
<LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish>https://iis02.egalware.com/WDC/SRV/swagger/index.html</SiteUrlToLaunchAfterPublish>
<ExcludeApp_Data>false</ExcludeApp_Data>
<ProjectGuid>c2109e71-4eae-4167-9052-175123ccc2bc</ProjectGuid>
<SelfContained>false</SelfContained>
<MSDeployServiceURL>https://iis02.egalware.com:8172/MsDeploy.axd</MSDeployServiceURL>
<DeployIisAppPath>Default Web Site/WDC/SRV</DeployIisAppPath>
<RemoteSitePhysicalPath />
<SkipExtraFilesOnServer>false</SkipExtraFilesOnServer>
<MSDeployPublishMethod>WMSVC</MSDeployPublishMethod>
<EnableMSDeployBackup>true</EnableMSDeployBackup>
<EnableMsDeployAppOffline>true</EnableMsDeployAppOffline>
<UserName>jenkins</UserName>
<_SavePWD>true</_SavePWD>
<_TargetId>IISWebDeploy</_TargetId>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
</Project>
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<WebPublishMethod>Package</WebPublishMethod>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish />
<LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
<ExcludeApp_Data>false</ExcludeApp_Data>
<ProjectGuid>c2109e71-4eae-4167-9052-175123ccc2bc</ProjectGuid>
<DesktopBuildPackageLocation>bin\publish\WDC.API.zip</DesktopBuildPackageLocation>
<PackageAsSingleFile>true</PackageAsSingleFile>
<DeployIisAppPath>Default Web Site/WDC/SRV</DeployIisAppPath>
<_TargetId>IISWebDeployPackage</_TargetId>
</PropertyGroup>
</Project>
@@ -7,7 +7,14 @@
</PropertyGroup>
<ItemGroup>
<_WebToolingArtifacts Remove="Properties\PublishProfiles\IIS-PROD.pubxml" />
<_WebToolingArtifacts Remove="Properties\PublishProfiles\IIS01.pubxml" />
<_WebToolingArtifacts Remove="Properties\PublishProfiles\IIS02.pubxml" />
<_WebToolingArtifacts Remove="Properties\PublishProfiles\IISProfile.pubxml" />
</ItemGroup>
<ItemGroup>
<None Include="Properties\PublishProfiles\IIS-PROD.pubxml.user" />
</ItemGroup>
<ItemGroup>
@@ -139,6 +139,33 @@ namespace WebDoorCreator.Data.Services
return fatto;
}
/// <summary>
/// Get Queue request done
/// </summary>
/// <returns>Dictionary of DoorId, saveVersNumb</returns>
public async Task<Dictionary<string, string>> RequestDone()
{
string source = "REDIS";
long numReq = 0;
Dictionary<string, string> dictResult = new Dictionary<string, string>();
// cerco da cache
RedisKey currKey = new RedisKey(Constants.CALC_REQ_DDF_CACHE);
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
numReq = redisDb.HashLength(currKey);
if (numReq > 0)
{
var rawData = await redisDb.HashGetAllAsync(currKey);
foreach (var item in rawData)
{
dictResult.Add($"{item.Name}", $"{item.Value}");
}
}
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Debug($"RequestDone | {source} in: {ts.TotalMilliseconds} ms");
return dictResult;
}
/// <summary>
/// Remove for single hash record
/// </summary>
@@ -394,6 +421,15 @@ namespace WebDoorCreator.Data.Services
await RequestProcessingRemove(item.Name!);
fatto = true;
}
// cerco le richieste processed
currKey = new RedisKey(Constants.CALC_REQ_DONE);
rawData = await redisDb.HashGetAllAsync(currKey);
foreach (var item in rawData)
{
await RequestPendingUpsert(item.Name!, item.Value!);
await RequestDoneRemove(item.Name!);
fatto = true;
}
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Debug($"ResetQueue | REDIS in: {ts.TotalMilliseconds} ms");
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<WebPublishMethod>MSDeploy</WebPublishMethod>
<LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish>https://iis04.egalware.com/WDC/UI/</SiteUrlToLaunchAfterPublish>
<ExcludeApp_Data>false</ExcludeApp_Data>
<ProjectGuid>c2109e71-4eae-4167-9052-175123ccc2bc</ProjectGuid>
<SelfContained>false</SelfContained>
<MSDeployServiceURL>https://iis04.egalware.com:8172/MsDeploy.axd</MSDeployServiceURL>
<DeployIisAppPath>Default Web Site/WDC/UI</DeployIisAppPath>
<RemoteSitePhysicalPath />
<SkipExtraFilesOnServer>false</SkipExtraFilesOnServer>
<MSDeployPublishMethod>WMSVC</MSDeployPublishMethod>
<EnableMSDeployBackup>true</EnableMSDeployBackup>
<EnableMsDeployAppOffline>true</EnableMsDeployAppOffline>
<UserName>jenkins</UserName>
<_SavePWD>true</_SavePWD>
<_TargetId>IISWebDeploy</_TargetId>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
</Project>
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<WebPublishMethod>MSDeploy</WebPublishMethod>
<LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish>https://iis02.egalware.com/WDC/UI/</SiteUrlToLaunchAfterPublish>
<ExcludeApp_Data>false</ExcludeApp_Data>
<ProjectGuid>c2109e71-4eae-4167-9052-175123ccc2bc</ProjectGuid>
<SelfContained>false</SelfContained>
<MSDeployServiceURL>https://iis02.egalware.com:8172/MsDeploy.axd</MSDeployServiceURL>
<DeployIisAppPath>Default Web Site/WDC/UI</DeployIisAppPath>
<RemoteSitePhysicalPath />
<SkipExtraFilesOnServer>false</SkipExtraFilesOnServer>
<MSDeployPublishMethod>WMSVC</MSDeployPublishMethod>
<EnableMSDeployBackup>true</EnableMSDeployBackup>
<EnableMsDeployAppOffline>true</EnableMsDeployAppOffline>
<UserName>jenkins</UserName>
<_SavePWD>true</_SavePWD>
<_TargetId>IISWebDeploy</_TargetId>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
</Project>
@@ -13,7 +13,10 @@
</ItemGroup>
<ItemGroup>
<_WebToolingArtifacts Remove="Properties\PublishProfiles\IIS-PROD.pubxml" />
<_WebToolingArtifacts Remove="Properties\PublishProfiles\IIS01.pubxml" />
<_WebToolingArtifacts Remove="Properties\PublishProfiles\IIS02.pubxml" />
<_WebToolingArtifacts Remove="Properties\PublishProfiles\IISProfile.pubxml" />
</ItemGroup>
<ItemGroup>
+34 -16
View File
@@ -195,16 +195,23 @@ namespace WeebDoorCreator.SDK
// cerco online
RestClient client = new RestClient(apiUrl);
var request = new RestRequest(URL);
var response = client.Get(request);
// controllo status code risposta
if (response.StatusCode == System.Net.HttpStatusCode.OK)
try
{
// deserializzo risposta
answ = response.Content;
var response = client.Get(request);
// controllo status code risposta
if (response.StatusCode == System.Net.HttpStatusCode.OK)
{
// deserializzo risposta
answ = response.Content;
}
else
{
answ = "KO";
}
}
else
catch
{
answ = "KO";
answ = "ERR";
}
// restituisco valore!
return answ;
@@ -242,7 +249,9 @@ namespace WeebDoorCreator.SDK
}
}
catch
{ }
{
answ = "ERR";
}
// restituisco valore!
return answ;
}
@@ -274,7 +283,9 @@ namespace WeebDoorCreator.SDK
}
}
catch
{ }
{
answ = "ERR";
}
// restituisco valore!
return answ;
}
@@ -305,16 +316,23 @@ namespace WeebDoorCreator.SDK
{
request.AddJsonBody(payload);
}
var response = client.Post(request);
// controllo status code risposta
if (response.StatusCode == System.Net.HttpStatusCode.OK)
try
{
// deserializzo risposta
answ = response.Content;
var response = client.Post(request);
// controllo status code risposta
if (response.StatusCode == System.Net.HttpStatusCode.OK)
{
// deserializzo risposta
answ = response.Content;
}
else
{
answ = "KO";
}
}
else
catch
{
answ = "KO";
answ = "ERR";
}
// restituisco valore!
return answ;