Skip to content

Commit

Permalink
Add monitor key
Browse files Browse the repository at this point in the history
  • Loading branch information
constantgillet committed May 2, 2024
1 parent 396c597 commit e91ca04
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions app/routes/api.simple-url.$templateId.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,19 @@ export const loader = async ({ params, request }: LoaderFunctionArgs) => {
//Save the image to S3 as a cache
uploadToS3(pngBuffer, imageLocation);

//Add redis log for doing analytics
const monitorKey = `simple-render-${templateId}-${
isDraft ? "draft" : "prod"
}:${new Date().getTime()}`;

//Save the log to redis
setCacheData(
monitorKey,
JSON.stringify({
values: variablesValues,
})
);

return new Response(pngBuffer, {
headers: {
"Content-Type": "image/png",
Expand Down

0 comments on commit e91ca04

Please sign in to comment.