mirror of
https://github.com/immich-app/immich.git
synced 2026-03-27 04:11:15 +03:00
fix(server): sync files to disk (#26881)
Ensure that all files are flushed after they've been written. At current, files are not explicitly flushed to disk, which can cause data corruption. In extreme circumstances, it's possible that uploaded files may not ever be persisted at all.
This commit is contained in:
@@ -63,7 +63,7 @@ export class StorageRepository {
|
||||
}
|
||||
|
||||
createWriteStream(filepath: string): Writable {
|
||||
return createWriteStream(filepath, { flags: 'w' });
|
||||
return createWriteStream(filepath, { flags: 'w', flush: true });
|
||||
}
|
||||
|
||||
createOrOverwriteFile(filepath: string, buffer: Buffer) {
|
||||
|
||||
Reference in New Issue
Block a user