@befaas/lib
Advanced tools
Comparing version 8.14.1 to 8.14.2
@@ -1,6 +0,6 @@ | ||
## 8.14.1 (2022-05-05) | ||
## 8.14.2 (2022-05-05) | ||
#### Bug Fixes | ||
* add some logging (d2ae0de6) | ||
* function endpoints are not known when publishers are deployed. Thus, publishers can not use the library. (0a0167e1) | ||
23
call.js
@@ -24,3 +24,3 @@ const _ = require('lodash') | ||
module.exports = async (fn, contextId, xPair, payload, a) => { | ||
module.exports = async (fn, contextId, xPair, payload) => { | ||
@@ -54,5 +54,4 @@ console.log("fn is: " + fn) | ||
return res.json() | ||
} else { | ||
if (a) { | ||
fetch(`${endpoints[provider]}/${fn}/call`, { | ||
} else { | ||
const res = await fetch(`${endpoints[provider]}/${fn}/call`, { | ||
method: 'post', | ||
@@ -65,17 +64,5 @@ body: JSON.stringify(payload || {}), | ||
} | ||
}) | ||
return "{}" | ||
} else { | ||
const res = await fetch(`${endpoints[provider]}/${fn}/call`, { | ||
method: 'post', | ||
body: JSON.stringify(payload || {}), | ||
headers: { | ||
'Content-Type': 'application/json', | ||
'X-Context': contextId, | ||
'X-Pair': xPair | ||
} | ||
}) | ||
return res.json() | ||
} | ||
}) | ||
return res.json() | ||
} | ||
} |
@@ -50,3 +50,3 @@ { | ||
}, | ||
"version": "8.14.1" | ||
"version": "8.14.2" | ||
} |
@@ -33,17 +33,6 @@ const _ = require('lodash') | ||
const end = measurement(`rpcOut:${f}:${xPair}`) | ||
const a = false | ||
const res = await call(f, contextId, xPair, payload, a) | ||
const res = await call(f, contextId, xPair, payload) | ||
end() | ||
return res | ||
}, | ||
callAsync: async (f, payload) => { | ||
console.log("In async call") | ||
const xPair = `${contextId}-${helper.generateRandomID()}` | ||
const end = measurement(`rpcOut:${f}:${xPair}`) | ||
const a = true | ||
console.log("before call in serverless.js") | ||
const res = await call(f, contextId, xPair, payload, a) | ||
end() | ||
return res | ||
}, | ||
mark: m => performance.mark(`${log.fnName}:${contextId}:${m}`), | ||
@@ -50,0 +39,0 @@ measure: measurement, |
6
55111639
474