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: "",
|
||||
minUserIDLength: 30,
|
||||
deArrowPaywall: false
|
||||
deArrowPaywall: false,
|
||||
useCacheForSegmentGroups: false,
|
||||
});
|
||||
loadFromEnv(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[]> {
|
||||
const fetchData = async () => await buildSegmentGroups(segments);
|
||||
|
||||
const groups = useCache
|
||||
const groups = useCache && config.useCacheForSegmentGroups
|
||||
? await QueryCacher.get(fetchData, skipSegmentGroupsKey(videoID, service))
|
||||
: await fetchData();
|
||||
|
||||
|
|
|
@ -101,7 +101,8 @@ export interface SBSConfig {
|
|||
},
|
||||
tokenSeed: string,
|
||||
minUserIDLength: number,
|
||||
deArrowPaywall: boolean
|
||||
deArrowPaywall: boolean,
|
||||
useCacheForSegmentGroups: boolean
|
||||
}
|
||||
|
||||
export interface WebhookConfig {
|
||||
|
|
Loading…
Reference in a new issue