jenkins-bot has submitted this change and it was merged.
Change subject: [IMPROV] CachedRequest: Cap expiry time by config ......................................................................
[IMPROV] CachedRequest: Cap expiry time by config
This prevents any caches longer than the configured time even if they are using a higher number.
Change-Id: Iab9fa866fe1c235455d02095a83fb83fb40fbb07 --- M pywikibot/data/api.py 1 file changed, 1 insertion(+), 1 deletion(-)
Approvals: John Vandenberg: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/data/api.py b/pywikibot/data/api.py index 71cc0a9..70e512b 100644 --- a/pywikibot/data/api.py +++ b/pywikibot/data/api.py @@ -1723,7 +1723,7 @@ super(CachedRequest, self).__init__(*args, **kwargs) if not isinstance(expiry, datetime.timedelta): expiry = datetime.timedelta(expiry) - self.expiry = expiry + self.expiry = min(expiry, datetime.timedelta(config.API_config_expiry)) self._data = None self._cachetime = None
pywikibot-commits@lists.wikimedia.org