toc.py: check date of last update
Closed this issue · 4 comments
kynikos commented
lahwaacz commented
Yep, I was thinking about this too lately... Do you think that a2f8520 is enough?
kynikos commented
Yep, same code as statistics.py, however that script aborts the operation sooner if the page has already been saved in the same day; what would you think about moving the date test to around L480, perhaps also checking self.cliargs.save
? (very minor nitpicking, I know, the script works brilliantly regardless of this!)
if self.cliargs.save and not self.cliargs.force and datetime.datetime.utcnow().date() <= parse_date(timestamp).date():
logger.info("The page '{}' has already been updated this UTC day.".format(title))
continue
lahwaacz commented
Well, that would not save a single query to the server, only a few CPU cycles. And the warnings would be hidden until the following UTC day...
kynikos commented
Indeed, I was only looking at the consistency with the other script, but the current version is optimal, thanks, I'll close this for you :)