Second potential fix for timeout

pull/3188/head
zomars 2022-06-28 15:46:07 -06:00
parent b6dd0d5804
commit 826583f404
1 changed files with 2 additions and 1 deletions

View File

@ -199,6 +199,7 @@ export const slotsRouter = createRouter().query("getSchedule", {
});
let time = input.timeZone === "Etc/GMT" ? startTime.utc() : startTime.tz(input.timeZone);
const parsedEndTime = input.timeZone === "Etc/GMT" ? endTime.utc() : endTime.tz(input.timeZone);
do {
// get slots retrieves the available times for a given day
const times = getSlots({
@ -238,7 +239,7 @@ export const slotsRouter = createRouter().query("getSchedule", {
}),
}));
time = time.add(1, "day");
} while (time.isBefore(endTime));
} while (time.isBefore(parsedEndTime));
return {
slots,