mirror of
https://github.com/microsoft/BCQuality.git
synced 2026-10-05 14:46:55 +01:00
# Conflicts: # microsoft/knowledge/performance/job-queue-category-code-serializes-conflicting-jobs.bad.al # microsoft/knowledge/performance/job-queue-category-code-serializes-conflicting-jobs.good.al # microsoft/knowledge/performance/job-queue-category-code-serializes-conflicting-jobs.md # microsoft/knowledge/performance/job-queue-external-effects-must-be-idempotent.bad.al # microsoft/knowledge/performance/job-queue-external-effects-must-be-idempotent.good.al # microsoft/knowledge/performance/job-queue-external-effects-must-be-idempotent.md # microsoft/knowledge/performance/job-queue-handlers-must-not-require-ui.bad.al # microsoft/knowledge/performance/job-queue-handlers-must-not-require-ui.good.al # microsoft/knowledge/performance/job-queue-handlers-must-not-require-ui.md # microsoft/knowledge/performance/job-queue-handlers-must-propagate-failures.bad.al # microsoft/knowledge/performance/job-queue-handlers-must-propagate-failures.good.al # microsoft/knowledge/performance/job-queue-handlers-must-propagate-failures.md # microsoft/knowledge/performance/job-queue-on-hold-does-not-stop-running-work.bad.al # microsoft/knowledge/performance/job-queue-on-hold-does-not-stop-running-work.good.al # microsoft/knowledge/performance/job-queue-on-hold-does-not-stop-running-work.md # microsoft/knowledge/performance/store-scheduled-task-id-to-avoid-duplicate-tasks.bad.al # microsoft/knowledge/performance/store-scheduled-task-id-to-avoid-duplicate-tasks.good.al # microsoft/knowledge/performance/store-scheduled-task-id-to-avoid-duplicate-tasks.md
57 lines
No EOL
1.3 KiB
AL
57 lines
No EOL
1.3 KiB
AL
table 50112 "Queued Export Bad"
|
|
{
|
|
DataClassification = CustomerContent;
|
|
|
|
fields
|
|
{
|
|
field(1; "Entry No."; Integer)
|
|
{
|
|
AutoIncrement = true;
|
|
}
|
|
field(2; Payload; Text[250])
|
|
{
|
|
}
|
|
}
|
|
|
|
keys
|
|
{
|
|
key(PK; "Entry No.")
|
|
{
|
|
Clustered = true;
|
|
}
|
|
}
|
|
}
|
|
|
|
codeunit 50112 "Queued Export Worker Bad"
|
|
{
|
|
TableNo = "Job Queue Entry";
|
|
|
|
trigger OnRun()
|
|
var
|
|
QueuedExport: Record "Queued Export Bad";
|
|
Client: HttpClient;
|
|
Content: HttpContent;
|
|
Response: HttpResponseMessage;
|
|
begin
|
|
if not QueuedExport.FindFirst() then
|
|
exit;
|
|
|
|
Content.WriteFrom(QueuedExport.Payload);
|
|
Client.Post('https://example.local/exports', Content, Response);
|
|
if not Response.IsSuccessStatusCode() then
|
|
Error('Export failed with HTTP status %1.', Response.HttpStatusCode());
|
|
|
|
// If this local step fails, the external export exists but this row is retried.
|
|
UpdateLocalStatus();
|
|
FinalizeExport(QueuedExport);
|
|
end;
|
|
|
|
local procedure UpdateLocalStatus()
|
|
begin
|
|
end;
|
|
|
|
local procedure FinalizeExport(var QueuedExport: Record "Queued Export Bad")
|
|
begin
|
|
QueuedExport.Delete();
|
|
end;
|
|
} |