Use the exact current time in KV and tempstore.

Created on 23 February 2017, almost 8 years ago
Updated 1 March 2023, almost 2 years ago

Problem/Motivation

The Brightcove module needs API access tokens, which expire every 5 minutes. Thereby it is using the KV expireable to invalidate these access tokens.
In a normal HTTP request, this is cool, but during a migration we ran into an issue, when the migration actually executes for longer than 5 minutes.
Along the long-running migration process, we REQUEST_TIME used inside the KV expireable never changes, even the real world time moves on.

In short, REQUEST_TIME does not equal to the \Drupal::time()->getCurrentTime().

Proposed resolution

Use the actual time in \Drupal\Core\KeyValueStore\DatabaseStorageExpirable. \Drupal\user\SharedTempStore and \Drupal\user\PrivateTempStore by leveraging the datetime.time service and its ::getCurrentTime method.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Needs work

Version

10.1

Component
Base 

Last updated 20 minutes ago

Created by

🇩🇪Germany dawehner

Live updates comments and jobs are added and updated live.
  • Needs framework manager review

    It is used to alert the framework manager core committer(s) that an issue significantly impacts (or has the potential to impact) multiple subsystems or represents a significant change or addition in architecture or public APIs, and their signoff is needed (see the governance policy draft for more information). If an issue significantly impacts only one subsystem, use Needs subsystem maintainer review instead, and make sure the issue component is set to the correct subsystem.

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