💄
This commit is contained in:
parent
abbc2e305d
commit
02d28757e8
2 changed files with 2 additions and 16 deletions
|
@ -187,18 +187,3 @@ export function mapPager<T, R>(pager: IPager<T>, fn: (t: T) => R): IPager<R> {
|
|||
getPage: (pageIndex, token) => pager.getPage(pageIndex, token).then(r => r.map(fn))
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Merges two pagers.
|
||||
*/
|
||||
export function mergePagers<T>(one: IPager<T>, other: IPager<T>): IPager<T> {
|
||||
return {
|
||||
firstPage: [...one.firstPage, ...other.firstPage],
|
||||
total: one.total + other.total,
|
||||
pageSize: one.pageSize + other.pageSize,
|
||||
getPage(pageIndex: number, token): Promise<T[]> {
|
||||
return Promise.all([one.getPage(pageIndex, token), other.getPage(pageIndex, token)])
|
||||
.then(([onePage, otherPage]) => [...onePage, ...otherPage]);
|
||||
}
|
||||
};
|
||||
}
|
|
@ -9,6 +9,7 @@ import { ITelemetryService, ITelemetryInfo, ITelemetryData } from 'vs/platform/t
|
|||
import { ClassifiedEvent, StrictPropertyCheck, GDPRClassification } from 'vs/platform/telemetry/common/gdprTypings';
|
||||
import { safeStringify } from 'vs/base/common/objects';
|
||||
import { isObject } from 'vs/base/common/types';
|
||||
import { Promises } from 'vs/base/common/async';
|
||||
|
||||
export const NullTelemetryService = new class implements ITelemetryService {
|
||||
declare readonly _serviceBrand: undefined;
|
||||
|
@ -47,7 +48,7 @@ export interface ITelemetryAppender {
|
|||
export function combinedAppender(...appenders: ITelemetryAppender[]): ITelemetryAppender {
|
||||
return {
|
||||
log: (e, d) => appenders.forEach(a => a.log(e, d)),
|
||||
flush: () => Promise.all(appenders.map(a => a.flush()))
|
||||
flush: () => Promises.settled(appenders.map(a => a.flush()))
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue