valhallasw added a comment.

After puzzling with @xzise on IRC, this is what we think happens:

- Initially, the Site object has no information loaded.
- site.version() calls the API with an expiry of 1 day. This loads the siteinfo 
from the apicache, including the site time
- site.getcurrenttime() is handled by Siteinfo's internal cache, which has a 
bug:

  12:40 < xzise> return cache_date + expire >= datetime.datetime.utcnow()
  12:40 < xzise> that seems wrong to me

(this should be `cache_date + expire < datetime.datetime.utcnow()`)
and thus returns the (max 1 day old) Siteinfo version.

I'm /not/ quite sure why the version request isn't handled by the Siteinfo 
internal cache, though.


TASK DETAIL
  https://phabricator.wikimedia.org/T94293

REPLY HANDLER ACTIONS
  Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign 
<username>.

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: XZise, valhallasw
Cc: valhallasw, XZise, Aklapper, PhantomTech, Gryllida, jayvdb, scfc, 
pywikipedia-bugs



_______________________________________________
Pywikipedia-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikipedia-bugs

Reply via email to