perf/get-schedule-with-tracing^2
Keith Williams 2023-09-12 14:40:08 -03:00
parent 3273876fd3
commit c3675f12ae
2 changed files with 4 additions and 5 deletions

View File

@ -143,6 +143,7 @@ export async function getBusyTimes(params: {
getBookingsSpan.end();
const calculateBusyTimesSpan = tracer.startSpan("busyTimes-" + userId, undefined, context.active());
const bookingSeatCountMap: { [x: string]: number } = {};
const busyTimes = bookings.reduce(
(aggregate: EventBusyDetails[], { id, startTime, endTime, eventType, title, ...rest }) => {

View File

@ -170,11 +170,6 @@ export const getUserAvailability = async function getUsersWorkingHoursLifeTheUni
const bookingLimits = parseBookingLimit(eventType?.bookingLimits);
const durationLimits = parseDurationLimit(eventType?.durationLimits);
// TODO: only query what we need after applying limits (shrink date range)
const getBusyTimesStart = dateFrom.toISOString();
const getBusyTimesEnd = dateTo.toISOString();
const busyTimesFromLimits =
eventType && (bookingLimits || durationLimits)
? await getBusyTimesFromLimits(
@ -188,6 +183,9 @@ export const getUserAvailability = async function getUsersWorkingHoursLifeTheUni
)
: [];
// TODO: only query what we need after applying limits (shrink date range)
const getBusyTimesStart = dateFrom.toISOString();
const getBusyTimesEnd = dateTo.toISOString();
const getBusyTimesSpan = tracer.startSpan("getBusyTimes-" + user.id, undefined, context.active());
const busyTimes = await getBusyTimes({
credentials: user.credentials,