* @brief HTTPS notification sender for task status updates * * @param notify_config [in] Server configuration object containing: * - server [string] Target hostname * - port [number] Target port * - path [string] API endpoint path * - method [string] HTTP method (GET/POST) * @par
(notify_config, notify_data, task_objid)
| 225 | * @note SSL verification disabled for development |
| 226 | */ |
| 227 | async function send_notification(notify_config, notify_data, task_objid) { |
| 228 | const options = prepare_request_options(notify_config, notify_data); |
| 229 | const memo = operation_memo({ ref: task_objid }); |
| 230 | |
| 231 | const req = https.request(options, (res) => { |
| 232 | handle_response(res, task_objid, memo); |
| 233 | }); |
| 234 | |
| 235 | req.on('error', (err) => { |
| 236 | logger(LOG_LEVEL.ERROR, |
| 237 | `Task ${task_objid} notification error ${err}`, |
| 238 | memo |
| 239 | ); |
| 240 | }); |
| 241 | |
| 242 | req.write(notify_data); |
| 243 | req.end(); |
| 244 | } |
| 245 | |
| 246 | /** |
| 247 | * @brief Prepare HTTPS request configuration |
no test coverage detected