From e68798c97458a29eb3328fbff696d2ac235c887b Mon Sep 17 00:00:00 2001 From: BostonRohan Date: Sat, 11 May 2024 21:52:42 -0400 Subject: [PATCH 1/4] feat: store yt video duration & views in sanity to run with cron jobs --- app/api/update-video-stats/route.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/app/api/update-video-stats/route.ts b/app/api/update-video-stats/route.ts index 98d850b..6d75d86 100644 --- a/app/api/update-video-stats/route.ts +++ b/app/api/update-video-stats/route.ts @@ -58,5 +58,6 @@ export async function GET(request: NextRequest) { ); } } + return Response.json({ success: true }); } From fbb4f36972eeb13d1c8fd048a4e50038ed3d87b8 Mon Sep 17 00:00:00 2001 From: BostonRohan Date: Sat, 11 May 2024 23:04:30 -0400 Subject: [PATCH 2/4] test: v6.7.0 @sanity/client --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index beeba98..428a8c2 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "@radix-ui/react-slot": "^1.0.2", "@radix-ui/react-toast": "^1.1.5", "@radix-ui/react-tooltip": "^1.0.7", - "@sanity/client": "^6.7.0", + "@sanity/client": "6.7.0", "@sanity/image-url": "^1.0.2", "@sanity/vision": "^3.18.1", "class-variance-authority": "^0.7.0", From 6c7c13706053aa352e24f3a321f458538a00106e Mon Sep 17 00:00:00 2001 From: BostonRohan Date: Sat, 11 May 2024 23:08:45 -0400 Subject: [PATCH 3/4] fix: frozen lockfile --- pnpm-lock.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6c9846e..2fbbf47 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -33,7 +33,7 @@ importers: specifier: ^1.0.7 version: 1.0.7(@types/react-dom@18.2.14)(@types/react@18.2.33)(react-dom@18.2.0(react@18.2.0))(react@18.2.0) '@sanity/client': - specifier: ^6.7.0 + specifier: 6.7.0 version: 6.7.0 '@sanity/image-url': specifier: ^1.0.2 @@ -5497,7 +5497,7 @@ snapshots: '@sanity/client@6.7.0': dependencies: - '@sanity/eventsource': 5.0.0 + '@sanity/eventsource': 5.0.1 get-it: 8.4.3 rxjs: 7.8.1 transitivePeerDependencies: From 8eea2b39bb72bf4c96f83471c2cf6646923371a1 Mon Sep 17 00:00:00 2001 From: BostonRohan Date: Sat, 11 May 2024 23:34:08 -0400 Subject: [PATCH 4/4] fix: max out max duration on cron --- app/api/update-video-stats/route.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/api/update-video-stats/route.ts b/app/api/update-video-stats/route.ts index 6d75d86..ae1729d 100644 --- a/app/api/update-video-stats/route.ts +++ b/app/api/update-video-stats/route.ts @@ -5,6 +5,8 @@ import client from "@/sanity/client"; import moment from "moment"; import "moment-duration-format"; +export const maxDuration = 60; + export async function GET(request: NextRequest) { const authHeader = request.headers.get("authorization"); if (authHeader !== `Bearer ${process.env.CRON_SECRET}`) {