Skip to content

Commit

Permalink
fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
patrykkopycinski committed Feb 13, 2022
1 parent 62cae64 commit 21754c6
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions x-pack/plugins/osquery/server/lib/telemetry/receiver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,7 @@ export class TelemetryReceiver {
throw Error('elasticsearch client is unavailable: cannot retrieve cluster infomation');
}

const { body } = await this.esClient.info();
return body;
return this.esClient.info();
}

public async fetchLicenseInfo(): Promise<ESLicense | undefined> {
Expand All @@ -101,15 +100,13 @@ export class TelemetryReceiver {
}

try {
const ret = (
await this.esClient.transport.request({
method: 'GET',
path: '/_license',
querystring: {
local: true,
},
})
).body as Promise<{ license: ESLicense }>;
const ret = (await this.esClient.transport.request({
method: 'GET',
path: '/_license',
querystring: {
local: true,
},
})) as { license: ESLicense };

return (await ret).license;
} catch (err) {
Expand Down

0 comments on commit 21754c6

Please sign in to comment.