Skip to content

Commit

Permalink
fix: reduce no-response errors in cal ai with increase of timeout thr…
Browse files Browse the repository at this point in the history
…eshold (calcom#11845)

* increase agent loop timeout threshold

* increase api/receive timeout threshold
  • Loading branch information
DexterStorey authored Oct 12, 2023
1 parent 522fd64 commit 2c5cb6a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions apps/ai/src/app/api/agent/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import agent from "../../../utils/agent";
import sendEmail from "../../../utils/sendEmail";
import { verifyParseKey } from "../../../utils/verifyParseKey";

// Allow agent loop to run for up to 5 minutes
export const maxDuration = 300;

/**
* Launches a LangChain agent to process an incoming email,
* then sends the response to the user.
Expand Down
4 changes: 4 additions & 0 deletions apps/ai/src/app/api/receive/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ import now from "../../../utils/now";
import sendEmail from "../../../utils/sendEmail";
import { verifyParseKey } from "../../../utils/verifyParseKey";

// Allow receive loop to run for up to 30 seconds
// Why so long? the rate determining API call (getAvailability, getEventTypes) can take up to 15 seconds at peak times so we give it a little extra time to complete.
export const maxDuration = 30;

/**
* Verifies email signature and app authorization,
* then hands off to booking agent.
Expand Down

0 comments on commit 2c5cb6a

Please sign in to comment.