MCPcopy Create free account
hub / github.com/AS-AIGC/TranscriptHub / send_notification

Function send_notification

apps/backend/utils.js:227–244  ·  view source on GitHub ↗

* @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)

Source from the content-addressed store, hash-verified

225 * @note SSL verification disabled for development
226 */
227async 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

Callers 1

execute_taskFunction · 0.85

Calls 4

prepare_request_optionsFunction · 0.85
operation_memoFunction · 0.85
handle_responseFunction · 0.85
loggerFunction · 0.85

Tested by

no test coverage detected