Update con cancellazione pdf oltre 6 mesi
This commit is contained in:
+1
-1
@@ -642,7 +642,7 @@ namespace LPA
|
|||||||
{
|
{
|
||||||
// parto da template base
|
// parto da template base
|
||||||
template = item.template;
|
template = item.template;
|
||||||
//se non c'è uso quello della cosa...
|
//se non c'è uso quello della coda...
|
||||||
if (string.IsNullOrEmpty(template))
|
if (string.IsNullOrEmpty(template))
|
||||||
{
|
{
|
||||||
template = confCoda.template;
|
template = confCoda.template;
|
||||||
|
|||||||
+28
-1
@@ -319,7 +319,34 @@ namespace LPA
|
|||||||
// salvo il log degli update
|
// salvo il log degli update
|
||||||
if (eliminati > 0)
|
if (eliminati > 0)
|
||||||
{
|
{
|
||||||
Log.Instance.Info($"Eliminati {eliminati} files temporanei da area temp");
|
Log.Instance.Info($"Eliminati {eliminati} files EMF temporanei da area temp");
|
||||||
|
}
|
||||||
|
|
||||||
|
// verifica file pdf vecchi (oltre 5 mesi...)
|
||||||
|
currPath = $"{baseDir}{localPdfPath}";
|
||||||
|
eliminati = 0;
|
||||||
|
// ottengo elenco files *.emf
|
||||||
|
fileMover.obj.setDirectory(currPath);
|
||||||
|
_fis = Directory.GetFiles(currPath, "*.pdf", SearchOption.AllDirectories);
|
||||||
|
fatto = false;
|
||||||
|
foreach (var _fileName in _fis)
|
||||||
|
{
|
||||||
|
FileInfo file = new FileInfo(_fileName);
|
||||||
|
if (file.CreationTime < DateTime.Now.AddMonths(-5)) // elimino files vecchi...
|
||||||
|
{
|
||||||
|
fatto = fileMover.obj.eliminaFile(file);
|
||||||
|
if (fatto)
|
||||||
|
{
|
||||||
|
Log.Instance.Info($"Eliminato file {file.Name}");
|
||||||
|
eliminati++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// salvo il log degli update
|
||||||
|
if (eliminati > 0)
|
||||||
|
{
|
||||||
|
Log.Instance.Info($"Eliminati {eliminati} files EMF temporanei da area temp");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
|
|||||||
Reference in New Issue
Block a user