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