File delete file gestito come try/catch (SE bloccati...)

This commit is contained in:
Samuele E. Locatelli
2020-10-09 08:41:13 +02:00
parent d6da3ac79b
commit e48d9cdbc6
2 changed files with 23 additions and 23 deletions
+22 -22
View File
@@ -38,9 +38,9 @@ namespace IOB_WIN
protected CachedString Last_CurrStatus = new CachedString() { Value = "00000" };
/// <summary>
/// Massimo delay lettura dati prima di considerarli scaduti (59 sec, ma x test 1 gg)
/// Massimo delay lettura dati prima di considerarli scaduti (30 sec, ma x test 1 gg)
/// </summary>
protected int maxDelaySec = 59;
protected int maxDelaySec = 30;
#endregion Protected Fields
@@ -167,7 +167,12 @@ namespace IOB_WIN
string[] file2del = Directory.GetFiles(BaseDir, searchPattern);
foreach (var file in file2del)
{
File.Delete(file);
try
{
File.Delete(file);
}
catch
{ }
}
}
}
@@ -375,25 +380,16 @@ namespace IOB_WIN
string[] file2del = Directory.GetFiles(BaseDir, cleanExt);
foreach (var file in file2del)
{
File.Delete(file);
try
{
File.Delete(file);
}
catch
{ }
}
}
}
#if false
/// <summary>
/// Pulizia folder da tutti i file RSP
/// </summary>
internal void cleanupResp()
{
string[] file2del = Directory.GetFiles(BaseDir, "*.RSP");
foreach (var file in file2del)
{
File.Delete(file);
}
}
#endif
/// <summary>
/// Pulizia folder dai file RSP della sessione
/// </summary>
@@ -402,7 +398,12 @@ namespace IOB_WIN
string[] file2del = Directory.GetFiles(BaseDir, $"{sessionName}.RSP");
foreach (var file in file2del)
{
File.Delete(file);
try
{
File.Delete(file);
}
catch
{ }
}
}
@@ -660,10 +661,9 @@ namespace IOB_WIN
{ }
if (Math.Abs(lastPub.Subtract(adesso).TotalSeconds) > maxDelaySec)
{
#if false
sessStatus.Active = false;
#endif
sessStatus.SessionValidUntil = adesso;
// elimino file RSP...
cleanupResp(sessStatus.SessionName);
}
}
}
Vendored
+1 -1
View File
@@ -9,7 +9,7 @@ pipeline {
steps {
/* calcolo numero versione... diverso x branch MASTER/DEVELOP */
script {
withEnv(['NEXT_BUILD_NUMBER=713']) {
withEnv(['NEXT_BUILD_NUMBER=714']) {
// env.versionNumber = VersionNumber(versionNumberString : '3.3.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true)
env.versionNumber = VersionNumber(versionNumberString : '3.3.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}')
env.APP_NAME = 'MAPO-IOB-WIN'