in src/scaler/scaler-core/index.js [563:585]
async function getOperationState(operationId, engine) {
const headers = {
otherArgs: {headers: {['x-goog-request-params']: `Name=${operationId}`}},
};
if (engine === AutoscalerEngine.REDIS) {
return await memorystoreRedisClient.getOperation(
RedisClusterProtos.google.longrunning.GetOperationRequest.fromObject({
name: operationId,
}),
headers,
);
} else if (engine === AutoscalerEngine.VALKEY) {
return await memorystoreValkeyClient.getOperation(
MemorystoreProtos.google.longrunning.GetOperationRequest.fromObject({
name: operationId,
}),
headers,
);
} else {
throw new Error(`Unknown engine retriving LRO state: ${engine}`);
}
}