Skip to content

Commit 32a4600

Browse files
committed
Refactor response handling in GetLog method to stream JSON and update status; enhance test assertions for target setting references
1 parent 0c4abd7 commit 32a4600

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

src/iop/cls/IOP/Service/Remote/Rest/v1.cls

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,11 @@ ClassMethod GetLog() As %Status
327327
Set entry.type = $CASE(tType, 1:"Assert", 2:"Error", 3:"Warning", 4:"Info", 5:"Trace", 6:"Alert", :"Unknown")
328328
Do result.%Push(entry)
329329
}
330-
Return ..%WriteResponse(result.%ToJSON())
330+
// Stream JSON to the device: result can exceed the string length limit (<MAXSTRING>)
331+
Set %response.ContentType = "application/json"
332+
Set %response.Status = "200 OK"
333+
Do result.%ToJSON()
334+
Return $$$OK
331335
} Catch ex {
332336
Return ..%WriteErrorResponse(ex.DisplayString())
333337
}

src/tests/unit/test_production.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3078,7 +3078,7 @@ def test_business_host_request_helpers_resolve_target_setting_refs():
30783078

30793079
assert host.send_request_sync(file.Output, "") == "ok"
30803080
host.iris_handle.dispatchSendRequestSync.assert_called_once_with(
3081-
"OrderOperation", "", -1, None
3081+
"OrderOperation", "", -1, '_BusinessHost -> OrderOperation'
30823082
)
30833083

30843084

@@ -3107,5 +3107,5 @@ def test_business_process_send_request_async_resolves_target_setting_refs():
31073107
process.send_request_async(file.Output, "", response_required=False)
31083108

31093109
process.iris_handle.dispatchSendRequestAsync.assert_called_once_with(
3110-
"OrderOperation", "", 0, None, None
3110+
"OrderOperation", "", 0, None, 'BusinessProcess -> OrderOperation'
31113111
)

0 commit comments

Comments
 (0)