test: add sleep to deleteRoom and bulkDeleteRooms for improved timing
This commit is contained in:
parent
49926459cd
commit
a7528ba8ac
@ -262,19 +262,23 @@ export const updateRecordingAccessPreferencesInRoom = async (roomId: string, rec
|
|||||||
export const deleteRoom = async (roomId: string, query: Record<string, any> = {}) => {
|
export const deleteRoom = async (roomId: string, query: Record<string, any> = {}) => {
|
||||||
checkAppIsRunning();
|
checkAppIsRunning();
|
||||||
|
|
||||||
return await request(app)
|
const result = await request(app)
|
||||||
.delete(`${INTERNAL_CONFIG.API_BASE_PATH_V1}/rooms/${roomId}`)
|
.delete(`${INTERNAL_CONFIG.API_BASE_PATH_V1}/rooms/${roomId}`)
|
||||||
.set(INTERNAL_CONFIG.API_KEY_HEADER, MEET_API_KEY)
|
.set(INTERNAL_CONFIG.API_KEY_HEADER, MEET_API_KEY)
|
||||||
.query(query);
|
.query(query);
|
||||||
|
await sleep('1s');
|
||||||
|
return result;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const bulkDeleteRooms = async (roomIds: any[], force?: any) => {
|
export const bulkDeleteRooms = async (roomIds: any[], force?: any) => {
|
||||||
checkAppIsRunning();
|
checkAppIsRunning();
|
||||||
|
|
||||||
return await request(app)
|
const result = await request(app)
|
||||||
.delete(`${INTERNAL_CONFIG.API_BASE_PATH_V1}/rooms`)
|
.delete(`${INTERNAL_CONFIG.API_BASE_PATH_V1}/rooms`)
|
||||||
.set(INTERNAL_CONFIG.API_KEY_HEADER, MEET_API_KEY)
|
.set(INTERNAL_CONFIG.API_KEY_HEADER, MEET_API_KEY)
|
||||||
.query({ roomIds: roomIds.join(','), force });
|
.query({ roomIds: roomIds.join(','), force });
|
||||||
|
await sleep('1s');
|
||||||
|
return result;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const deleteAllRooms = async () => {
|
export const deleteAllRooms = async () => {
|
||||||
@ -301,6 +305,8 @@ export const deleteAllRooms = async () => {
|
|||||||
.query({ roomIds: roomIds.join(','), force: true })
|
.query({ roomIds: roomIds.join(','), force: true })
|
||||||
.set(INTERNAL_CONFIG.API_KEY_HEADER, MEET_API_KEY);
|
.set(INTERNAL_CONFIG.API_KEY_HEADER, MEET_API_KEY);
|
||||||
} while (nextPageToken);
|
} while (nextPageToken);
|
||||||
|
|
||||||
|
await sleep('1s');
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user