Skip to content

Commit

Permalink
[Lens] Clean up usage collector (#89109) (#89416)
Browse files Browse the repository at this point in the history
  • Loading branch information
flash1293 authored Jan 27, 2021
1 parent 81438b2 commit 51342f9
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions x-pack/plugins/lens/server/usage/collectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ export function registerLensUsageCollector(
usageCollection: UsageCollectionSetup,
taskManager: Promise<TaskManagerStartContract>
) {
let isCollectorReady = false;
taskManager.then(() => {
// mark lensUsageCollector as ready to collect when the TaskManager is ready
isCollectorReady = true;
});
const lensUsageCollector = usageCollection.makeUsageCollector<LensUsage>({
type: 'lens',
async fetch() {
Expand Down Expand Up @@ -55,7 +50,10 @@ export function registerLensUsageCollector(
};
}
},
isReady: () => isCollectorReady,
isReady: async () => {
await taskManager;
return true;
},
schema: lensUsageSchema,
});

Expand Down

0 comments on commit 51342f9

Please sign in to comment.