Skip to content

Commit 113e4ec

Browse files
committed
await
1 parent 8885b1a commit 113e4ec

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/utilization/gcp-info.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ module.exports.clearCache = function clearGCPCache() {
1717
resultDict = null
1818
}
1919

20-
function fetchGCPInfo(agent, callback) {
20+
21+
async function fetchGCPInfo(agent, callback) {
2122
if (!agent.config.utilization || !agent.config.utilization.detect_gcp) {
2223
logger.trace({ utilization: 'gcp' }, 'Skipping GCP due to being disabled via config.')
2324
return setImmediate(callback, null)
@@ -28,10 +29,10 @@ function fetchGCPInfo(agent, callback) {
2829
return setImmediate(callback, null, resultDict)
2930
}
3031

31-
const isAvail = gcpMetadata.isAvailable()
32+
const isAvail = await gcpMetadata.isAvailable()
3233
if (isAvail) {
33-
console.debug('hostname: ', gcpMetadata.instance('hostname'))
34-
console.debug('instanceId: ', gcpMetadata.instance('id'))
34+
console.debug('hostname: ', await gcpMetadata.instance('hostname'))
35+
console.debug('instanceId: ', await gcpMetadata.instance('id'))
3536
}
3637

3738
common.request(

0 commit comments

Comments
 (0)