Fetch runs out after a minute in my "use node" action
"use node";
import { api } from "./_generated/api";
export async function generateAndUploadVideo(ctx,auth,title,script,tags){
let url = process.env.MOVIEAPI_URL+"/generate";
if(auth == null){
return;
}
let videoResponse = await fetch(url,{
method:"POST",
body:JSON.stringify({
"script":script
}),
keepalive:true
});//This line always times out at a minute
let video = await videoResponse.blob();
const storageId = await ctx.storage.store(video);
await ctx.runMutation(api.video.storeVideo,{
video:storageId,
title:title,
creator:auth,
tags:tags
});
await ctx.runAction(api.googleActions.uploadToYoutube,{
video:storageId,
title:title,
user:auth,
tags:tags
});
}"use node";
import { api } from "./_generated/api";
export async function generateAndUploadVideo(ctx,auth,title,script,tags){
let url = process.env.MOVIEAPI_URL+"/generate";
if(auth == null){
return;
}
let videoResponse = await fetch(url,{
method:"POST",
body:JSON.stringify({
"script":script
}),
keepalive:true
});//This line always times out at a minute
let video = await videoResponse.blob();
const storageId = await ctx.storage.store(video);
await ctx.runMutation(api.video.storeVideo,{
video:storageId,
title:title,
creator:auth,
tags:tags
});
await ctx.runAction(api.googleActions.uploadToYoutube,{
video:storageId,
title:title,
user:auth,
tags:tags
});
}The fetch in this function always times out at 60 seconds.
