Page MenuHomePhabricator

Add force option to editTime
Closed, DeclinedPublic

Description

Originally from: http://sourceforge.net/p/pywikipediabot/patches/571/
Reported by: strainu
Created on: 2012-10-27 15:35:07
Subject: Force retrieval of last edit time
Original description:
This patch changes the Page.editTime function in order to allow the user to request a valid editTime even if the page has not yet been fetched. The API call used is theoretically much lighter than retrieving the whole page. The default behavior remains unchanged.


Version: unspecified
Severity: enhancement
See Also:
https://sourceforge.net/p/pywikipediabot/patches/571

Details

Reference
bz54555

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 2:10 AM
bzimport set Reference to bz54555.
bzimport added a subscriber: Unknown Object (????).

As a performance optimization, line 1256 could read

if force and not self.\_editTime:

However, I wrote the patch without checking if the editTime has been fetched because "force" should imply that the value is updated

The patch you made can be added to both core (in page.py) and compat (wikipedia.py) even though the patch is made for compat.

Sounds like a good idea

Hmm, I had forgot about this patch, despite the fact that I use it daily :)

Do you want me to put the patch up for review?

My patch no longer makes sense with the current code. Note that the current implementation still retrieves the whole page if we want the editTime, which is overkill, but that's not the object of the current bug.

Strainu set Security to None.

Added a new patch for review at https://gerrit.wikimedia.org/r/#/c/205065/

Turns out retrieving the page each time I want the editTime is not really OK for me. This patch also changes the default as I believe it is better to use cached values whenever possible.