Disable query cache for segment groups

This commit is contained in:
Ajay 2024-02-04 22:53:12 -05:00
parent 121cc7f481
commit c54c25c73b
3 changed files with 5 additions and 3 deletions

View file

@ -189,7 +189,8 @@ addDefaults(config, {
},
tokenSeed: "",
minUserIDLength: 30,
deArrowPaywall: false
deArrowPaywall: false,
useCacheForSegmentGroups: false,
});
loadFromEnv(config);
migrate(config);

View file

@ -288,7 +288,7 @@ function getWeightedRandomChoice<T extends VotableObject>(choices: T[], amountOf
async function chooseSegments(videoID: VideoID, service: Service, segments: DBSegment[], useCache: boolean): Promise<DBSegment[]> {
const fetchData = async () => await buildSegmentGroups(segments);
const groups = useCache
const groups = useCache && config.useCacheForSegmentGroups
? await QueryCacher.get(fetchData, skipSegmentGroupsKey(videoID, service))
: await fetchData();

View file

@ -101,7 +101,8 @@ export interface SBSConfig {
},
tokenSeed: string,
minUserIDLength: number,
deArrowPaywall: boolean
deArrowPaywall: boolean,
useCacheForSegmentGroups: boolean
}
export interface WebhookConfig {