mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2024-11-10 01:02:30 +01:00
Disable query cache for segment groups
This commit is contained in:
parent
121cc7f481
commit
c54c25c73b
3 changed files with 5 additions and 3 deletions
|
@ -189,7 +189,8 @@ addDefaults(config, {
|
||||||
},
|
},
|
||||||
tokenSeed: "",
|
tokenSeed: "",
|
||||||
minUserIDLength: 30,
|
minUserIDLength: 30,
|
||||||
deArrowPaywall: false
|
deArrowPaywall: false,
|
||||||
|
useCacheForSegmentGroups: false,
|
||||||
});
|
});
|
||||||
loadFromEnv(config);
|
loadFromEnv(config);
|
||||||
migrate(config);
|
migrate(config);
|
||||||
|
|
|
@ -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[]> {
|
async function chooseSegments(videoID: VideoID, service: Service, segments: DBSegment[], useCache: boolean): Promise<DBSegment[]> {
|
||||||
const fetchData = async () => await buildSegmentGroups(segments);
|
const fetchData = async () => await buildSegmentGroups(segments);
|
||||||
|
|
||||||
const groups = useCache
|
const groups = useCache && config.useCacheForSegmentGroups
|
||||||
? await QueryCacher.get(fetchData, skipSegmentGroupsKey(videoID, service))
|
? await QueryCacher.get(fetchData, skipSegmentGroupsKey(videoID, service))
|
||||||
: await fetchData();
|
: await fetchData();
|
||||||
|
|
||||||
|
|
|
@ -101,7 +101,8 @@ export interface SBSConfig {
|
||||||
},
|
},
|
||||||
tokenSeed: string,
|
tokenSeed: string,
|
||||||
minUserIDLength: number,
|
minUserIDLength: number,
|
||||||
deArrowPaywall: boolean
|
deArrowPaywall: boolean,
|
||||||
|
useCacheForSegmentGroups: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface WebhookConfig {
|
export interface WebhookConfig {
|
||||||
|
|
Loading…
Reference in a new issue