mirror of
https://github.com/oddluck/limnoria-plugins.git
synced 2025-04-25 20:41:21 -05:00
SpiffyTitles: cacheGlobal config option
This commit is contained in:
parent
23443ee6bd
commit
5b9997ff9e
@ -129,6 +129,13 @@ conf.registerGlobalValue(
|
||||
registry.Integer(600, _("""Link cache lifetime in seconds""")),
|
||||
)
|
||||
|
||||
# Link cache lifetime
|
||||
conf.registerGlobalValue(
|
||||
SpiffyTitles,
|
||||
"cacheGlobal",
|
||||
registry.Boolean(False, _("""Keep link title cache globally""")),
|
||||
)
|
||||
|
||||
conf.registerChannelValue(
|
||||
SpiffyTitles,
|
||||
"ignoredMessagePattern",
|
||||
|
@ -248,6 +248,8 @@ class SpiffyTitles(callbacks.Plugin):
|
||||
Check if we have this link cached according to the cache lifetime. If so, serve
|
||||
link from the cache instead of calling handlers.
|
||||
"""
|
||||
if self.registryValue("cacheGlobal"):
|
||||
channel = "global"
|
||||
cached_link = self.get_link_from_cache(url, channel)
|
||||
if cached_link:
|
||||
title = cached_link["title"]
|
||||
|
Loading…
x
Reference in New Issue
Block a user