From ae30424e18c26af2b9103572cdaaeab5851e48a2 Mon Sep 17 00:00:00 2001 From: sagIoTPower Date: Tue, 14 May 2024 10:48:11 +0200 Subject: [PATCH] changed creating a timer --- repository/blocks/EnhancedHttpOutputBlock.mon | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/repository/blocks/EnhancedHttpOutputBlock.mon b/repository/blocks/EnhancedHttpOutputBlock.mon index b337b2d..c7db095 100644 --- a/repository/blocks/EnhancedHttpOutputBlock.mon +++ b/repository/blocks/EnhancedHttpOutputBlock.mon @@ -28,10 +28,12 @@ event HTTPHandler { string deviceId; string host; + BlockBase base; /** Handle the HTTP response.*/ action handleResponse(Response res) { // $base.createTimer(0.01, res); // Creates a timer with the specified duration. - TimerParams tp := TimerParams.relative(0.01).withPayload(res).withPartition(deviceId); + // TimerParams tp := TimerParams.relative(0.01).withPayload(res).withPartition(deviceId); + base.relative(0.01).withPayload(res).withPartition(deviceId); log "Called handleResponse: " + res.payload.data.toString() at INFO; if not res.isSuccess() { @@ -186,7 +188,7 @@ event EnhancedHTTPOutput { // Execute the request and pass the callback action. string deviceId := $activation.partition.toString(); log "Processing for partition: " + deviceId at INFO; - req.execute(HTTPHandler(deviceId, $parameters.host).handleResponse); + req.execute(HTTPHandler(deviceId, $parameters.host, $base).handleResponse); $base.profile(BlockBase.PROFILE_OUTPUT); }