Tweak outdated page behavior/function timeouts
This commit is contained in:
parent
61d2039d6a
commit
791d020c94
@ -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()}{')'}
|
||||
{' '}
|
||||
|
||||
@ -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',
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user