Piscal Queue working more resilient to error

This commit is contained in:
2016-04-18 10:44:36 -04:00
parent 6623aa48ea
commit ca1a235c1d
21 changed files with 418 additions and 176 deletions
+25
View File
@@ -0,0 +1,25 @@
using LeafWeb.Core.Entities;
using LeafWeb.Core.Remote;
namespace LeafWeb.Web.Services
{
public class Cleanup : PiscalQueueWorker
{
protected override void DoWorkInternal(LeafInput leafInput)
{
try
{
Logger.Info("LeafInput: {0}, Cleanup", leafInput.Id);
PiscalService.Cleanup(leafInput);
}
catch (PiscalClientException ex)
{
var errorMessage = FormatException(ex, ex.LeafInputId);
Logger.Error(errorMessage, ex);
// log the error, but ignore the cleanup issue for now
Logger.Info("LeafInput: {0}, Cleanup - likely has not occurred", leafInput.Id);
}
}
}
}