Skip to content

Commit

Permalink
Add logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Rindrics committed Oct 18, 2024
1 parent 7256469 commit 50bc3b3
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const flushMetricsAndShutdown = async (lf: Langfuse, metricReader: any) => {
reject(new Error("Metric flush timeout after 20 seconds"));
}, 20000);

console.log("inside waitUntil()-----")
Promise.all([metricReader.forceFlush(), lf.shutdownAsync()])
.then(() => {
clearTimeout(timeoutId);
Expand Down Expand Up @@ -75,6 +76,7 @@ export async function generateArtifactStream(
subscriptionId,
isR06User,
});
console.log("before waitUntil()-----")
waitUntil(
flushMetricsAndShutdown(lf, metricReader).catch((error) => {
if (error.message === "Metric flush timeout after 20 seconds") {
Expand All @@ -90,6 +92,7 @@ export async function generateArtifactStream(
}
}),
);
console.log("after waitUntil()-----")
generation.end({
output: result,
});
Expand All @@ -105,6 +108,8 @@ export async function generateArtifactStream(
stream.done();
})();

console.log("before return-----")

return { object: stream.value };
}

Expand Down

0 comments on commit 50bc3b3

Please sign in to comment.