Closed (fixed)
Project:
Redirect
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
11 Dec 2019 at 12:33 UTC
Updated:
30 Dec 2019 at 21:34 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
arpad.rozsa commentedComment #3
berdirCan't we just do date('d', $last_daily_reset) != date('d')?
We don't need a full diff, if the day doesn't match, we can reset.
Lets use \Drupal::requestTime()->getRequestTime() for that.
db_query() is deprecated, should use \Drupal::database()->query()
Lets simulate also that we don't delete it every time we call the function.
So insert/update a row with daily counts, call cron again, make sure it's still there.
db_insert() is deprected too. We should not update everything, but since we touch this line and the D9 patch will conflict, lets update this one too.
Comment #4
arpad.rozsa commentedUpdated the patch.
Comment #6
berdirDid some manual tests, seems to work nicely.