Я пытаюсь выполнить HTTP-вызов с помощью оркестрованной функции. Код отлично работает на моем локальном компьютере, но после развертывания на Azure он не будет ждать yield
и будет работать до завершения после обнаружения http-вызова.
Фрагмент для вызова Orchestrator
const df = require("durable-functions");
module.exports = async function (context, inputValue) {
const client = df.getClient(context);
const instanceId = await client.startNew("TaskOrchastrator", undefined, { ...inputValue });
context.log(`Started orchestration with ID = '${instanceId}'.`);
};
Код для Task Orchastrator
const df = require("durable-functions");
module.exports = df.orchestrator(function* (context) {
context.log('Starting function');
/**
* Populated the values here
*/
var rslt = yield context.df.callHttp('POST', postUrl, postData, {
Authorization: authToken,
'Content-Type': 'application/json',
});
context.log(`Successfully got ${rslt}`);
});
За всю жизнь я не мог понять, почему и как это умирает. Ошибки нет, поэтому я предполагаю, что это сценарий отказа от вызова, но ничего конкретного.
Сразу после http-вызова Azure журналы сообщат, что задача выполнена успешно.