Rewrite all time-based checks to use microtime

Created on 30 July 2015, over 9 years ago
Updated 6 November 2023, over 1 year ago

Problem/Motivation

The module currently relies upon the time() function to track when various caches are cleared. The time() function tracks events to the nearest second. The problem is that there can be thousands of operations within an individual second, so a second becomes an extremely imprecise value to work from. The current system leads to issues like #2444221: cache_lifetime should not affect cache_clear_all() β†’ , whereby it's impossible to discern between cache_set() being called before or after a cache_clear_all().

Proposed resolution

Change all time-based logic to use microtime() instead of time().

Remaining tasks

Write a patch, test it.

User interface changes

None.

API changes

None.

Data model changes

Additional variables are kept to track the microtime of various events in addition to the timestamp.

πŸ› Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024