fix: invoke function carry X-Fc-Invocation-Code-Version:Latest

This commit is contained in:
wss-git 2021-12-20 14:52:19 +08:00
parent f0468eddf3
commit 24e0676581
1 changed files with 5 additions and 0 deletions

View File

@ -82,6 +82,7 @@ export default class RemoteInvoke {
if (invocationType === 'Sync') {
const rs = await this.fcClient.invokeFunction(serviceName, functionName, event, {
'X-Fc-Log-Type': 'Tail',
'X-Fc-Invocation-Code-Version': 'Latest',
'X-Fc-Invocation-Type': invocationType,
}, qualifier);
@ -92,6 +93,7 @@ export default class RemoteInvoke {
} else {
logger.debug(`Stateful async invocation id: ${statefulAsyncInvocationId}`);
const { headers } = await this.fcClient.invokeFunction(serviceName, functionName, event, {
'X-Fc-Invocation-Code-Version': 'Latest',
'X-Fc-Invocation-Type': invocationType,
'X-Fc-Stateful-Async-Invocation-Id': statefulAsyncInvocationId,
}, qualifier);
@ -118,6 +120,9 @@ export default class RemoteInvoke {
if (!headers['X-Fc-Log-Type']) {
headers['X-Fc-Log-Type'] = 'Tail';
}
if (!headers['X-Fc-Invocation-Code-Version']) {
headers['X-Fc-Invocation-Code-Version'] = 'Latest';
}
let resp;
try {