mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-07-13 22:53:01 +02:00
Remove settings cache (#2203)
This commit is contained in:
@ -2,7 +2,7 @@ import "./globals.css";
|
|||||||
|
|
||||||
import {
|
import {
|
||||||
fetchEnterpriseSettingsSS,
|
fetchEnterpriseSettingsSS,
|
||||||
getCombinedSettings,
|
fetchSettingsSS,
|
||||||
} from "@/components/settings/lib";
|
} from "@/components/settings/lib";
|
||||||
import {
|
import {
|
||||||
CUSTOM_ANALYTICS_ENABLED,
|
CUSTOM_ANALYTICS_ENABLED,
|
||||||
@ -48,7 +48,7 @@ export default async function RootLayout({
|
|||||||
}: {
|
}: {
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
}) {
|
}) {
|
||||||
const combinedSettings = await getCombinedSettings({});
|
const combinedSettings = await fetchSettingsSS();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
|
@ -50,16 +50,3 @@ export async function fetchSettingsSS() {
|
|||||||
|
|
||||||
return combinedSettings;
|
return combinedSettings;
|
||||||
}
|
}
|
||||||
|
|
||||||
let cachedSettings: CombinedSettings;
|
|
||||||
|
|
||||||
export async function getCombinedSettings({
|
|
||||||
forceRetrieval,
|
|
||||||
}: {
|
|
||||||
forceRetrieval?: boolean;
|
|
||||||
}): Promise<CombinedSettings> {
|
|
||||||
if (!cachedSettings || forceRetrieval) {
|
|
||||||
cachedSettings = await fetchSettingsSS();
|
|
||||||
}
|
|
||||||
return cachedSettings;
|
|
||||||
}
|
|
||||||
|
Reference in New Issue
Block a user