forked from ddrilling/AsbCloudServer
Add ReportService.EnqueueCreateReportWork Add OnError handler
This commit is contained in:
parent
39de15e1ba
commit
ed67556742
@ -98,6 +98,17 @@ namespace AsbCloudInfrastructure.Services
|
|||||||
};
|
};
|
||||||
|
|
||||||
var work = Work.CreateByDelegate(workId, workAction);
|
var work = Work.CreateByDelegate(workId, workAction);
|
||||||
|
work.OnErrorAsync = (message, exception, token) => Task.Run(() => progressHandler.Invoke(new
|
||||||
|
{
|
||||||
|
Operation = "error",
|
||||||
|
Progress = 100f,
|
||||||
|
Message = string.IsNullOrEmpty(message)
|
||||||
|
? exception.Message
|
||||||
|
: message,
|
||||||
|
Exception = exception,
|
||||||
|
}, workId)
|
||||||
|
, token);
|
||||||
|
|
||||||
backgroundWorkerService.Enqueue(work);
|
backgroundWorkerService.Enqueue(work);
|
||||||
|
|
||||||
progressHandler.Invoke(new ReportProgressDto
|
progressHandler.Invoke(new ReportProgressDto
|
||||||
|
Loading…
Reference in New Issue
Block a user