fix: use plain read stream instead of real

This commit is contained in:
izzy
2025-12-18 14:40:59 +00:00
parent c045fa27af
commit 92d23ce955
2 changed files with 6 additions and 3 deletions

View File

@@ -1,6 +1,5 @@
import { Injectable } from '@nestjs/common';
import { createHash } from 'node:crypto';
import { createReadStream } from 'node:fs';
import { basename } from 'node:path';
import { Readable, Writable } from 'node:stream';
import { pipeline } from 'node:stream/promises';
@@ -519,7 +518,7 @@ export class IntegrityService extends BaseService {
const hash = createHash('sha1');
await pipeline([
createReadStream(originalPath),
this.storageRepository.createPlainReadStream(originalPath),
new Writable({
write(chunk, _encoding, callback) {
hash.update(chunk);
@@ -593,7 +592,7 @@ export class IntegrityService extends BaseService {
const hash = createHash('sha1');
await pipeline([
createReadStream(path),
this.storageRepository.createPlainReadStream(path),
new Writable({
write(chunk, _encoding, callback) {
hash.update(chunk);