Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mikecote committed Apr 19, 2021
1 parent 06fdfb5 commit 8fda03e
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import {
} from 'kibana/server';
import { TaskInstance } from '../../../task_manager/server';
import { SpacesPluginStart } from '../../../spaces/server';
import { bulkDelete, extractBulkResponseDeleteFailures, spaceIdToNamespace } from './lib';
import { bulkDelete, extractBulkResponseDeleteFailures } from './lib';
import { spaceIdToNamespace } from '../lib';

export interface CleanupTasksOpts {
logger: Logger;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@
*/

export { extractBulkResponseDeleteFailures } from './extract_bulk_response_delete_failures';
export { spaceIdToNamespace } from './space_id_to_namespace';
export { bulkDelete } from './bulk_delete';
2 changes: 1 addition & 1 deletion x-pack/plugins/actions/server/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const configSchema = schema.object({
responseTimeout: schema.duration({ defaultValue: '60s' }),
cleanupFailedExecutionsTask: schema.object({
enabled: schema.boolean({ defaultValue: true }),
interval: schema.duration({ defaultValue: '15s' }),
interval: schema.duration({ defaultValue: '5m' }),
pageSize: schema.number({ defaultValue: 100 }),
}),
});
Expand Down
1 change: 1 addition & 0 deletions x-pack/plugins/actions/server/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export { ActionExecutor, ActionExecutorContract } from './action_executor';
export { ILicenseState, LicenseState } from './license_state';
export { verifyApiAccess } from './verify_api_access';
export { getActionTypeFeatureUsageName } from './get_action_type_feature_usage_name';
export { spaceIdToNamespace } from './space_id_to_namespace';
export {
ActionTypeDisabledError,
ActionTypeDisabledReason,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import { SpacesPluginStart } from '../../../../spaces/server';
import { SpacesPluginStart } from '../../../spaces/server';

export function spaceIdToNamespace(spaces?: SpacesPluginStart, spaceId?: string) {
return spaces && spaceId ? spaces.spacesService.spaceIdToNamespace(spaceId) : undefined;
Expand Down
16 changes: 8 additions & 8 deletions x-pack/plugins/actions/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,18 @@ import {
} from './cleanup_failed_executions';

import { ActionsConfig, getValidatedConfig } from './config';
import { ActionExecutor, TaskRunnerFactory, LicenseState, ILicenseState } from './lib';
import { ActionsClient } from './actions_client';
import { ActionTypeRegistry } from './action_type_registry';
import { createExecutionEnqueuerFunction } from './create_execute_function';
import { registerBuiltInActionTypes } from './builtin_action_types';
import { registerActionsUsageCollector } from './usage';
import {
ActionExecutor,
TaskRunnerFactory,
LicenseState,
ILicenseState,
spaceIdToNamespace,
} from './lib';
import {
Services,
ActionType,
Expand Down Expand Up @@ -368,18 +374,12 @@ export class ActionsPlugin implements Plugin<PluginSetupContract, PluginStartCon
preconfiguredActions,
});

const spaceIdToNamespace = (spaceId?: string) => {
return plugins.spaces && spaceId
? plugins.spaces.spacesService.spaceIdToNamespace(spaceId)
: undefined;
};

taskRunnerFactory!.initialize({
logger,
actionTypeRegistry: actionTypeRegistry!,
encryptedSavedObjectsClient,
basePathService: core.http.basePath,
spaceIdToNamespace,
spaceIdToNamespace: (spaceId?: string) => spaceIdToNamespace(plugins.spaces, spaceId),
getUnsecuredSavedObjectsClient: (request: KibanaRequest) =>
this.getUnsecuredSavedObjectsClient(core.savedObjects, request),
});
Expand Down

0 comments on commit 8fda03e

Please sign in to comment.