Skip to content

Commit

Permalink
80697: add warning statement
Browse files Browse the repository at this point in the history
  • Loading branch information
nnamdifrankie committed Oct 16, 2020
1 parent 7d55560 commit 4d26d4a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,14 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { Logger } from 'src/core/server';
import * as Registry from '../../registry';
import { appContextService } from '../../../app_context';

export const getAsset = (path: string): Buffer => {
return Registry.getAsset(path);
};

export const getLogger = (): Logger => {
return appContextService.getLogger();
};
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import { SavedObjectsClientContract } from 'kibana/server';
import { CallESAsCurrentUser, ElasticsearchAssetType, EsAssetReference } from '../../../../types';
import { PACKAGES_SAVED_OBJECT_TYPE } from '../../../../../common/constants';
import { getLogger } from './common';

export const stopTransforms = async (transformIds: string[], callCluster: CallESAsCurrentUser) => {
for (const transformId of transformIds) {
Expand Down Expand Up @@ -56,6 +57,8 @@ export const deleteTransforms = async (
ignore: [404],
});
}
} else {
getLogger().warn(`cannot find transform for ${transformId}`);
}
})
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jest.mock('../../packages/get', () => {
jest.mock('./common', () => {
return {
getAsset: jest.fn(),
getLogger: jest.fn(),
};
});

Expand Down

0 comments on commit 4d26d4a

Please sign in to comment.