Pass idler and statusupdate callback as an argument to the export persisted state function
Summary: This diff passes the idler and statusUpdate arguments to the export persisted state, as it is being used in the MobileConfig's export function Reviewed By: passy Differential Revision: D17715815 fbshipit-source-id: 98a0f0f5950254de2139c4aaa52cb73401c86c3c
This commit is contained in:
committed by
Facebook Github Bot
parent
485898f5c7
commit
6e6873a4f6
@@ -101,6 +101,8 @@ export abstract class FlipperBasePlugin<
|
||||
callClient: (method: string, params?: any) => Promise<any>,
|
||||
persistedState: StaticPersistedState | undefined,
|
||||
store: MiddlewareAPI | undefined,
|
||||
idler?: Idler,
|
||||
statusUpdate?: (msg: string) => void,
|
||||
) => Promise<StaticPersistedState | undefined>)
|
||||
| null;
|
||||
static getActiveNotifications:
|
||||
|
||||
@@ -381,6 +381,7 @@ export async function fetchMetadata(
|
||||
pluginsMap: Map<string, typeof FlipperDevicePlugin | typeof FlipperPlugin>,
|
||||
store: MiddlewareAPI,
|
||||
statusUpdate?: (msg: string) => void,
|
||||
idler?: Idler,
|
||||
): Promise<{pluginStates: PluginStatesState; errorArray: Array<Error>}> {
|
||||
const newPluginState = {...pluginStates};
|
||||
const errorArray: Array<Error> = [];
|
||||
@@ -413,7 +414,13 @@ export async function fetchMetadata(
|
||||
statusUpdate(`Fetching metadata for plugin ${plugin}...`);
|
||||
const data = await promiseTimeout(
|
||||
120000, // Timeout in 2 mins
|
||||
exportState(callClient(client, plugin), newPluginState[key], store),
|
||||
exportState(
|
||||
callClient(client, plugin),
|
||||
newPluginState[key],
|
||||
store,
|
||||
idler,
|
||||
statusUpdate,
|
||||
),
|
||||
`Timed out while collecting data for ${plugin}`,
|
||||
);
|
||||
newPluginState[key] = data;
|
||||
@@ -459,6 +466,7 @@ export async function getStoreExport(
|
||||
pluginsMap,
|
||||
store,
|
||||
statusUpdate,
|
||||
idler,
|
||||
);
|
||||
const {errorArray} = metadata;
|
||||
const newPluginState = metadata.pluginStates;
|
||||
|
||||
Reference in New Issue
Block a user