Skip to content

Commit

Permalink
remove the saved objects client wrapper and update types
Browse files Browse the repository at this point in the history
  • Loading branch information
jesuswr committed Nov 28, 2024
1 parent d17f1d5 commit f8d1ba9
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/plugins/telemetry/server/fetcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@ import type { TelemetryCollectionManagerPluginStart } from '@kbn/telemetry-colle
import {
type PluginInitializerContext,
type Logger,
type SavedObjectsClientContract,
SavedObjectsClient,
type CoreStart,
type ISavedObjectsRepository,
} from '@kbn/core/server';
import { getTelemetryChannelEndpoint } from '../common/telemetry_config';
import {
Expand Down Expand Up @@ -77,7 +76,7 @@ export class FetcherTask {
private readonly subscriptions = new Subscription();
private readonly isOnline$ = new BehaviorSubject<boolean>(false); // Let's initially assume we are not online
private readonly lastReported$ = new BehaviorSubject<number>(0);
private internalRepository?: SavedObjectsClientContract;
private internalRepository?: ISavedObjectsRepository;
private telemetryCollectionManager?: TelemetryCollectionManagerPluginStart;

constructor(initializerContext: PluginInitializerContext<TelemetryConfigType>) {
Expand All @@ -87,9 +86,7 @@ export class FetcherTask {
}

public start({ savedObjects }: CoreStart, { telemetryCollectionManager }: FetcherTaskDepsStart) {
this.internalRepository = new SavedObjectsClient(
savedObjects.createInternalRepository([TELEMETRY_SAVED_OBJECT_TYPE])
);
this.internalRepository = savedObjects.createInternalRepository([TELEMETRY_SAVED_OBJECT_TYPE]);
this.telemetryCollectionManager = telemetryCollectionManager;

this.subscriptions.add(this.validateConnectivity());
Expand Down

0 comments on commit f8d1ba9

Please sign in to comment.