[Security Solution] fix failed packages call infinite retry (#103998)
This commit is contained in:
parent
b612fca2e7
commit
a842a731e8
|
@ -36,8 +36,7 @@ import {
|
|||
getLastLoadedActivityLogData,
|
||||
detailsData,
|
||||
getEndpointDetailsFlyoutView,
|
||||
getIsEndpointPackageInfoPending,
|
||||
getIsEndpointPackageInfoSuccessful,
|
||||
getIsEndpointPackageInfoUninitialized,
|
||||
} from './selectors';
|
||||
import { AgentIdsPendingActions, EndpointState, PolicyIds } from '../types';
|
||||
import {
|
||||
|
@ -598,7 +597,7 @@ async function getEndpointPackageInfo(
|
|||
dispatch: Dispatch<EndpointPackageInfoStateChanged>,
|
||||
coreStart: CoreStart
|
||||
) {
|
||||
if (getIsEndpointPackageInfoPending(state) || getIsEndpointPackageInfoSuccessful(state)) return;
|
||||
if (!getIsEndpointPackageInfoUninitialized(state)) return;
|
||||
|
||||
dispatch({
|
||||
type: 'endpointPackageInfoStateChanged',
|
||||
|
|
|
@ -33,6 +33,7 @@ import {
|
|||
isFailedResourceState,
|
||||
isLoadedResourceState,
|
||||
isLoadingResourceState,
|
||||
isUninitialisedResourceState,
|
||||
} from '../../../state';
|
||||
|
||||
import { ServerApiError } from '../../../../common/types';
|
||||
|
@ -69,15 +70,10 @@ export const policyItemsLoading = (state: Immutable<EndpointState>) => state.pol
|
|||
export const selectedPolicyId = (state: Immutable<EndpointState>) => state.selectedPolicyId;
|
||||
|
||||
export const endpointPackageInfo = (state: Immutable<EndpointState>) => state.endpointPackageInfo;
|
||||
export const getIsEndpointPackageInfoPending: (
|
||||
export const getIsEndpointPackageInfoUninitialized: (
|
||||
state: Immutable<EndpointState>
|
||||
) => boolean = createSelector(endpointPackageInfo, (packageInfo) =>
|
||||
isLoadingResourceState(packageInfo)
|
||||
);
|
||||
export const getIsEndpointPackageInfoSuccessful: (
|
||||
state: Immutable<EndpointState>
|
||||
) => boolean = createSelector(endpointPackageInfo, (packageInfo) =>
|
||||
isLoadedResourceState(packageInfo)
|
||||
isUninitialisedResourceState(packageInfo)
|
||||
);
|
||||
|
||||
export const isAutoRefreshEnabled = (state: Immutable<EndpointState>) => state.isAutoRefreshEnabled;
|
||||
|
|
Loading…
Reference in a new issue