Merge pull request #57921 from nextcloud/fix/snowflake_lock_dir

fix(snowflakes): create file lock files into lock directory
This commit is contained in:
Benjamin Gaussorgues 2026-02-04 11:12:23 +01:00 committed by GitHub
commit 687261fc8c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View file

@ -33,6 +33,9 @@ class FileSequence implements ISequence {
private function ensureWorkdirExists(): void {
if (is_dir($this->workDir)) {
if (!is_writable($this->workDir)) {
throw new \Exception('File sequence directory exists but is not writable');
}
return;
}
@ -104,6 +107,6 @@ class FileSequence implements ISequence {
}
private function getFilePath(int $fileId): string {
return $this->workDir . sprintf(self::LOCK_FILE_FORMAT, $fileId);
return $this->workDir . '/' . sprintf(self::LOCK_FILE_FORMAT, $fileId);
}
}

View file

@ -30,6 +30,5 @@ class FileSequenceTest extends ISequenceBase {
foreach (glob($lockDirectory . '/*') as $file) {
unlink($file);
}
rmdir($lockDirectory);
}
}