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.
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.