IO-797 Add fault tolerance for scanning.

This commit is contained in:
Patrick Fic
2021-03-24 11:01:43 -07:00
parent 1f6d0abe21
commit de14a8c4ac
4 changed files with 104 additions and 78 deletions

View File

@@ -5,7 +5,7 @@ using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json.Linq;
namespace BodyshopPartner.Utils
{
public static class DiskScan
@@ -32,18 +32,22 @@ namespace BodyshopPartner.Utils
};
dynamic job = Utils.Decoder.EstimateDecoder.CIECAEstimateImport.DecodeEstimate(envfp);
EstimatesOnDisk.Add(new ScanResponseItem()
if (!(job is Boolean))
{
Id = job.ciecaid,
Filepath = envfp,
Cieca_Id = job.ciecaid,
Clm_No = job.clm_no,
Owner = job.ownr_fn?.Value + " " + job.ownr_ln?.Value,
Ins_Co_Nm = job.ins_co_nm?.Value,
Vehicle = job.vehicle.data.v_model_yr.Value + " " + job.vehicle.data.v_make_desc.Value + " " + job.vehicle.data.v_model_desc.Value,
});
EstimatesOnDisk.Add(new ScanResponseItem()
{
Id = job.ciecaid,
Filepath = envfp,
Cieca_Id = job.ciecaid,
Clm_No = job.clm_no,
Owner = job.ownr_fn?.Value + " " + job.ownr_ln?.Value,
Ins_Co_Nm = job.ins_co_nm?.Value,
Vehicle = job.vehicle.data.v_model_yr.Value + " " + job.vehicle.data.v_make_desc.Value + " " + job.vehicle.data.v_model_desc.Value,
});
}
});
logger.Info("Estimates found: " + ad1FilePaths.Count);
return EstimatesOnDisk;