Added a span for all users' bookings
parent
f9ea62ae2d
commit
3273876fd3
|
@ -141,6 +141,8 @@ export async function getBusyTimes(params: {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
getBookingsSpan.end();
|
||||||
|
|
||||||
const bookingSeatCountMap: { [x: string]: number } = {};
|
const bookingSeatCountMap: { [x: string]: number } = {};
|
||||||
const busyTimes = bookings.reduce(
|
const busyTimes = bookings.reduce(
|
||||||
(aggregate: EventBusyDetails[], { id, startTime, endTime, eventType, title, ...rest }) => {
|
(aggregate: EventBusyDetails[], { id, startTime, endTime, eventType, title, ...rest }) => {
|
||||||
|
|
|
@ -306,6 +306,8 @@ export async function getAvailableSlots({ input, ctx }: GetScheduleOptions) {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const getBookingsSpan = tracer.startSpan("getBookingsAllUsers", undefined, context.active());
|
||||||
|
|
||||||
const currentBookingsAllUsers = await prisma.booking.findMany({
|
const currentBookingsAllUsers = await prisma.booking.findMany({
|
||||||
where: {
|
where: {
|
||||||
OR: [
|
OR: [
|
||||||
|
@ -355,6 +357,8 @@ export async function getAvailableSlots({ input, ctx }: GetScheduleOptions) {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
getBookingsSpan.end();
|
||||||
|
|
||||||
/* We get all users working hours and busy slots */
|
/* We get all users working hours and busy slots */
|
||||||
const userAvailability = await Promise.all(
|
const userAvailability = await Promise.all(
|
||||||
usersWithCredentials.map(async (currentUser) => {
|
usersWithCredentials.map(async (currentUser) => {
|
||||||
|
|
Loading…
Reference in New Issue