Skip to content

Commit a56b5cd

Browse files
authored
Add debug logging to cron
1 parent 126c151 commit a56b5cd

File tree

1 file changed

+3
-2
lines changed
  • app/api/internal/shared-sync/[board_name]

1 file changed

+3
-2
lines changed

app/api/internal/shared-sync/[board_name]/route.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,15 @@ export const maxDuration = 300;
1010
const CRON_SECRET = process.env.CRON_SECRET;
1111

1212
export async function GET(request: Request, { params }: { params: BoardRouteParameters }) {
13-
const { board_name }: ParsedBoardRouteParameters = parseBoardRouteParams(params);
14-
1513
try {
14+
const { board_name }: ParsedBoardRouteParameters = parseBoardRouteParams(params);
15+
console.log(`Starting shared sync for ${board_name}`);
1616
// Basic auth check
1717
const authHeader = request.headers.get('authorization');
1818
if (process.env.VERCEL_ENV !== 'development' && authHeader !== `Bearer ${CRON_SECRET}`) {
1919
return NextResponse.json({ error: 'Unauthorized' }, { status: 401 });
2020
}
21+
console.log(`Passed auth for ${board_name}`);
2122

2223
const result = syncSharedData(board_name);
2324

0 commit comments

Comments
 (0)