Skip to content

Commit 5ea95e7

Browse files
committed
fix(snowflakes): fix APCu cache restarted detection
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
1 parent 5060d64 commit 5ea95e7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/private/Snowflake/Generator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ private function getSequenceId(int $seconds, int $milliseconds, int $serverId):
118118

119119
// Use APCu as fastest local cache, but not shared between processes in CLI
120120
if (!$this->isCli() && function_exists('apcu_enabled') && apcu_enabled()) {
121-
if ((int)apcu_cache_info(true)['creation_time'] === $seconds) {
121+
if ((int)apcu_cache_info(true)['start_time'] === $seconds) {
122122
// APCu cache was just started
123123
// It means a sequence was maybe deleted
124124
return false;

0 commit comments

Comments
 (0)