Remove db optimization experiment
This commit is contained in:
parent
984039edce
commit
b9c31153f2
@ -136,7 +136,6 @@ export default function AdminAppConfigurationClient({
|
||||
// Internal
|
||||
areInternalToolsEnabled,
|
||||
areAdminDebugToolsEnabled,
|
||||
isAdminDbOptimizeEnabled,
|
||||
isAdminSqlDebugEnabled,
|
||||
// Connection status
|
||||
databaseError,
|
||||
@ -981,15 +980,6 @@ export default function AdminAppConfigurationClient({
|
||||
features like photo matting, baseline grid, etc.:
|
||||
{renderEnvVars(['ADMIN_DEBUG_TOOLS'])}
|
||||
</ChecklistRow>
|
||||
<ChecklistRow
|
||||
title="DB optimize"
|
||||
status={isAdminDbOptimizeEnabled}
|
||||
optional
|
||||
>
|
||||
Set environment variable to {'"1"'} to prevent
|
||||
homepages from seeding infinite scroll on load:
|
||||
{renderEnvVars(['ADMIN_DB_OPTIMIZE'])}
|
||||
</ChecklistRow>
|
||||
<ChecklistRow
|
||||
title="SQL debugging"
|
||||
status={isAdminSqlDebugEnabled}
|
||||
|
||||
@ -389,7 +389,6 @@ export const PAGE_SCRIPT_URLS = process.env.PAGE_SCRIPT_URLS
|
||||
// INTERNAL
|
||||
|
||||
export const ADMIN_DEBUG_TOOLS_ENABLED = process.env.ADMIN_DEBUG_TOOLS === '1';
|
||||
export const ADMIN_DB_OPTIMIZE_ENABLED = process.env.ADMIN_DB_OPTIMIZE === '1';
|
||||
export const ADMIN_SQL_DEBUG_ENABLED =
|
||||
process.env.ADMIN_SQL_DEBUG === '1' &&
|
||||
!IS_BUILDING;
|
||||
@ -514,11 +513,9 @@ export const APP_CONFIGURATION = {
|
||||
// Internal
|
||||
areInternalToolsEnabled: (
|
||||
ADMIN_DEBUG_TOOLS_ENABLED ||
|
||||
ADMIN_DB_OPTIMIZE_ENABLED ||
|
||||
ADMIN_SQL_DEBUG_ENABLED
|
||||
),
|
||||
areAdminDebugToolsEnabled: ADMIN_DEBUG_TOOLS_ENABLED,
|
||||
isAdminDbOptimizeEnabled: ADMIN_DB_OPTIMIZE_ENABLED,
|
||||
isAdminSqlDebugEnabled: ADMIN_SQL_DEBUG_ENABLED,
|
||||
// Misc
|
||||
baseUrl: BASE_URL,
|
||||
|
||||
@ -1,13 +1,7 @@
|
||||
'use client';
|
||||
|
||||
import useSwrInfinite from 'swr/infinite';
|
||||
import {
|
||||
ReactNode,
|
||||
useCallback,
|
||||
useEffect,
|
||||
useMemo,
|
||||
useRef,
|
||||
} from 'react';
|
||||
import { ReactNode, useCallback, useMemo, useRef } from 'react';
|
||||
import AppGrid from '@/components/AppGrid';
|
||||
import Spinner from '@/components/Spinner';
|
||||
import { getPhotosCachedAction, getPhotosAction } from '@/photo/actions';
|
||||
@ -16,7 +10,6 @@ import { PhotoSetCategory } from '../category';
|
||||
import { clsx } from 'clsx/lite';
|
||||
import { useAppState } from '@/app/AppState';
|
||||
import useVisibility from '@/utility/useVisibility';
|
||||
import { ADMIN_DB_OPTIMIZE_ENABLED } from '@/app/config';
|
||||
import { SortBy } from './sort';
|
||||
import { SWR_KEYS } from '@/swr';
|
||||
import { useAppText } from '@/i18n/state/client';
|
||||
@ -114,19 +107,13 @@ export default function InfinitePhotoScroll({
|
||||
keyGenerator,
|
||||
fetcher,
|
||||
{
|
||||
initialSize: ADMIN_DB_OPTIMIZE_ENABLED ? 0 : 2,
|
||||
initialSize: 2,
|
||||
revalidateFirstPage: false,
|
||||
revalidateOnFocus: Boolean(isUserSignedIn),
|
||||
revalidateOnReconnect: Boolean(isUserSignedIn),
|
||||
},
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
if (ADMIN_DB_OPTIMIZE_ENABLED) {
|
||||
fetcher(`${SIZE_KEY_SEPARATOR}0`, true);
|
||||
}
|
||||
}, [fetcher]);
|
||||
|
||||
const buttonContainerRef = useRef<HTMLDivElement>(null);
|
||||
|
||||
const isLoadingOrValidating = isLoading || isValidating;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user