mirror of
https://github.com/eliasstepanik/core.git
synced 2026-01-11 09:08:28 +00:00
fix: timeout in space assignment and return response in add
This commit is contained in:
parent
084ad5be85
commit
de94f67f7b
@ -14,8 +14,8 @@ const { action, loader } = createHybridActionApiRoute(
|
||||
corsStrategy: "all",
|
||||
},
|
||||
async ({ body, authentication }) => {
|
||||
const response = addToQueue(body, authentication.userId);
|
||||
return json({ ...response });
|
||||
const response = await addToQueue(body, authentication.userId);
|
||||
return json({ success: true, id: response.id });
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
@ -174,7 +174,7 @@ async function checkAndTriggerSpacePatterns(
|
||||
|
||||
export const spaceAssignmentTask = task({
|
||||
id: "space-assignment",
|
||||
maxDuration: 900, // 15 minutes timeout
|
||||
maxDuration: 1800, // 15 minutes timeout
|
||||
run: async (payload: SpaceAssignmentPayload) => {
|
||||
const {
|
||||
userId,
|
||||
@ -550,7 +550,7 @@ async function processBatchAI(
|
||||
requests: batchRequests,
|
||||
outputSchema: AssignmentResultSchema,
|
||||
maxRetries: 3,
|
||||
timeoutMs: 600000, // 10 minutes timeout
|
||||
timeoutMs: 1200000, // 10 minutes timeout
|
||||
});
|
||||
|
||||
logger.info(`Batch AI job created: ${batchId}`, {
|
||||
@ -560,7 +560,7 @@ async function processBatchAI(
|
||||
});
|
||||
|
||||
// Poll for completion with improved handling
|
||||
const maxPollingTime = 780000; // 10 minutes
|
||||
const maxPollingTime = 1200000; // 13 minutes
|
||||
const pollInterval = 5000; // 5 seconds
|
||||
const startTime = Date.now();
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user