diff --git a/src/admin/AdminOutdatedClient.tsx b/src/admin/AdminOutdatedClient.tsx index 1c2ea4e0..c6a955f8 100644 --- a/src/admin/AdminOutdatedClient.tsx +++ b/src/admin/AdminOutdatedClient.tsx @@ -50,11 +50,16 @@ export default function AdminOutdatedClient({ const photosToSync = photos .slice(0, UPDATE_BATCH_SIZE) .map(photo => photo.id); + const isFinalBatch = photosToSync.length >= photos.length; setPhotoIdsSyncing(photosToSync); syncPhotosAction(photosToSync) .finally(() => { - setPhotoIdsSyncing([]); - router.refresh(); + if (isFinalBatch) { + router.push(PATH_ADMIN_PHOTOS); + } else { + setPhotoIdsSyncing([]); + router.refresh(); + } }); } }} @@ -78,7 +83,7 @@ export default function AdminOutdatedClient({ {photos.length} {' '} {photos.length === 1 ? 'photo' : 'photos'} - {' ('}uploaded before + {' ('}last updated before {' '} {new Date(OUTDATED_THRESHOLD).toLocaleDateString()}{')'} {' '} diff --git a/src/app/admin/outdated/page.tsx b/src/app/admin/outdated/page.tsx index a6d707b1..adb47cfe 100644 --- a/src/app/admin/outdated/page.tsx +++ b/src/app/admin/outdated/page.tsx @@ -3,6 +3,8 @@ import { OUTDATED_THRESHOLD } from '@/photo'; import AdminOutdatedClient from '@/admin/AdminOutdatedClient'; import { AI_TEXT_GENERATION_ENABLED } from '@/site/config'; +export const maxDuration = 60; + export default async function AdminOutdatedPage() { const photos = await getPhotos({ hidden: 'include', diff --git a/src/app/admin/photos/page.tsx b/src/app/admin/photos/page.tsx index 41c59dad..4ae24299 100644 --- a/src/app/admin/photos/page.tsx +++ b/src/app/admin/photos/page.tsx @@ -5,6 +5,8 @@ import { OUTDATED_THRESHOLD } from '@/photo'; import AdminPhotosClient from '@/admin/AdminPhotosClient'; import { revalidatePath } from 'next/cache'; +export const maxDuration = 60; + const DEBUG_PHOTO_BLOBS = false; const INFINITE_SCROLL_INITIAL_ADMIN_PHOTOS = 25;