mirror of
https://github.com/oddluck/limnoria-plugins.git
synced 2025-04-29 23:11:09 -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""")),
|
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(
|
conf.registerChannelValue(
|
||||||
SpiffyTitles,
|
SpiffyTitles,
|
||||||
"ignoredMessagePattern",
|
"ignoredMessagePattern",
|
||||||
|
@ -248,6 +248,8 @@ class SpiffyTitles(callbacks.Plugin):
|
|||||||
Check if we have this link cached according to the cache lifetime. If so, serve
|
Check if we have this link cached according to the cache lifetime. If so, serve
|
||||||
link from the cache instead of calling handlers.
|
link from the cache instead of calling handlers.
|
||||||
"""
|
"""
|
||||||
|
if self.registryValue("cacheGlobal"):
|
||||||
|
channel = "global"
|
||||||
cached_link = self.get_link_from_cache(url, channel)
|
cached_link = self.get_link_from_cache(url, channel)
|
||||||
if cached_link:
|
if cached_link:
|
||||||
title = cached_link["title"]
|
title = cached_link["title"]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user