Skip to content

Commit a0b8b31

Browse files
committed
feat: add timeout for 60 seconds
Signed-off-by: Animesh Pathak <[email protected]>
1 parent b93d6a4 commit a0b8b31

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

Dockerfile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ COPY package.json package-lock.json* ./
99

1010
# Install dependencies
1111
RUN npm install --legacy-peer-deps
12-
RUN npm ci
1312
# Copy the rest of the application files
1413
COPY . .
1514

@@ -22,12 +21,11 @@ FROM builder AS runner
2221
# Set the working directory
2322
WORKDIR /app
2423
COPY --from=builder /app/public ./public
25-
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
2624
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
2725

2826
# Expose the application port
2927
EXPOSE 3100
3028

3129
# Start the application on port 3100
3230
ENV PORT=3100
33-
CMD ["npm", "run", "dev"]
31+
CMD ["npm", "run", "dev"]

src/app/api/generateWallpaper/route.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { NextResponse } from 'next/server';
22
import axios from 'axios';
3+
export const maxDuration = 60; // This function can run for a maximum of 5 seconds
4+
export const dynamic = 'force-dynamic';
35

46
export async function POST(request: Request) {
57
try {
@@ -29,10 +31,4 @@ export async function POST(request: Request) {
2931
console.error('Error generating images:', error);
3032
return NextResponse.json({ error: 'Failed to generate images' }, { status: 500 });
3133
}
32-
}
33-
34-
35-
// // Validate environment variables
36-
// const endpoint = process.env.AZURE_OPENAI_ENDPOINT;
37-
// const key = process.env.AZURE_OPENAI_KEY;
38-
// const apiVersion = '2024-02-01';
34+
}

0 commit comments

Comments
 (0)