Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes timeouts for Mage #1555

Merged
merged 2 commits into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion wasp-ai/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ RUN cd server && PRISMA_CLIENT_OUTPUT_DIR=../server/node_modules/.prisma/client/
RUN cd server && npm run build

FROM base AS server-production
RUN curl -sSL https://get.wasp-lang.dev/installer.sh | sh -s -- -v 0.11.1-wasp-ai-11
RUN curl -sSL https://get.wasp-lang.dev/installer.sh | sh -s -- -v 0.11.4-wasp-ai-12
ENV PATH "$PATH:/root/.local/bin"
ENV NODE_ENV production
WORKDIR /app
Expand Down
3 changes: 1 addition & 2 deletions wasp-ai/src/server/jobs/failStaleGenerations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@ export const failStaleGenerations: FailStaleAppsJobs<
success: boolean;
}
> = async (_args, context) => {
// If a generation has been in progress for > 5 minutes, it fails it
log("Failing stale generations");
const { Project, Log } = context.entities;

const now = getNowInUTC();
const fiveMinutesAgo = new Date(now.getTime() - 5 * 60 * 1000);
const fiveMinutesAgo = new Date(now.getTime() - 10 * 60 * 1000);

try {
const staleProjects = await Project.findMany({
Expand Down
2 changes: 1 addition & 1 deletion waspc/src/Wasp/AI/OpenAI/ChatGPT.hs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ queryChatGPT apiKey params requestMessages = do
request =
-- 90 seconds should be more than enough for ChatGPT to generate an answer, or reach its own timeout.
-- If it proves in the future that it might need more time, we can increase this number.
HTTP.setRequestResponseTimeout (HTTP.C.responseTimeoutMicro $ Util.secondsToMicroSeconds 90) $
HTTP.setRequestResponseTimeout (HTTP.C.responseTimeoutMicro $ Util.secondsToMicroSeconds 300) $
HTTP.setRequestHeader "Authorization" [BSU.fromString $ "Bearer " <> apiKey] $
HTTP.setRequestBodyJSON reqBodyJson $
HTTP.parseRequest_ "POST https://api.openai.com/v1/chat/completions"
Expand Down
Loading