Skip to content

Commit

Permalink
[Reporting] Update more Server Types for TaskManager (#74915)
Browse files Browse the repository at this point in the history
* [Reporting] Update more Server Types for TaskManager

* remove some task manager references

* more strict

* more strict 2

* simplify

* fix test

* fix test

* routing validation unused types cleanup

* remove more casting in route handlers

* feedback changes

* original comment was fine

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
  • Loading branch information
tsullivan and elasticmachine committed Aug 13, 2020
1 parent ee9a8d2 commit a8ed1f4
Show file tree
Hide file tree
Showing 37 changed files with 774 additions and 415 deletions.
8 changes: 1 addition & 7 deletions x-pack/plugins/reporting/server/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import { HeadlessChromiumDriverFactory } from './browsers/chromium/driver_factor
import { screenshotsObservableFactory } from './lib/screenshots';
import { checkLicense, getExportTypesRegistry } from './lib';
import { ESQueueInstance } from './lib/create_queue';
import { EnqueueJobFn } from './lib/enqueue_job';
import { ReportingStore } from './lib/store';

export interface ReportingInternalSetup {
Expand All @@ -36,7 +35,6 @@ export interface ReportingInternalSetup {

export interface ReportingInternalStart {
browserDriverFactory: HeadlessChromiumDriverFactory;
enqueueJob: EnqueueJobFn;
esqueue: ESQueueInstance;
store: ReportingStore;
savedObjects: SavedObjectsServiceStart;
Expand Down Expand Up @@ -115,7 +113,7 @@ export class ReportingCore {
/*
* Gives async access to the startDeps
*/
private async getPluginStartDeps() {
public async getPluginStartDeps() {
if (this.pluginStartDeps) {
return this.pluginStartDeps;
}
Expand All @@ -131,10 +129,6 @@ export class ReportingCore {
return (await this.getPluginStartDeps()).esqueue;
}

public async getEnqueueJob() {
return (await this.getPluginStartDeps()).enqueueJob;
}

public async getLicenseInfo() {
const { licensing } = this.getPluginSetupDeps();
return await licensing.license$
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
*/

import { cryptoFactory } from '../../lib';
import { ESQueueCreateJobFn, ScheduleTaskFnFactory } from '../../types';
import { CreateJobFn, ScheduleTaskFnFactory } from '../../types';
import { JobParamsDiscoverCsv } from './types';

export const scheduleTaskFnFactory: ScheduleTaskFnFactory<ESQueueCreateJobFn<
export const scheduleTaskFnFactory: ScheduleTaskFnFactory<CreateJobFn<
JobParamsDiscoverCsv
>> = function createJobFactoryFn(reporting) {
const config = reporting.getConfig();
Expand Down
Loading

0 comments on commit a8ed1f4

Please sign in to comment.