fix(snowflake_ids): allow multiple instance with same temp directory

Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
This commit is contained in:
Benjamin Gaussorgues 2026-02-23 11:46:07 +01:00 committed by backportbot[bot]
parent acd481bb7b
commit e8b214085a

View file

@ -9,6 +9,7 @@ declare(strict_types=1);
namespace OC\Snowflake;
use OC_Util;
use OCP\ITempManager;
use Override;
@ -27,7 +28,7 @@ class FileSequence implements ISequence {
public function __construct(
ITempManager $tempManager,
) {
$this->workDir = $tempManager->getTempBaseDir() . '/' . self::LOCK_FILE_DIRECTORY;
$this->workDir = $tempManager->getTempBaseDir() . '/' . self::LOCK_FILE_DIRECTORY . '_' . OC_Util::getInstanceId();
$this->ensureWorkdirExists();
}