mirror of
https://github.com/immich-app/immich.git
synced 2026-05-18 03:10:24 +03:00
fix abortion return
This commit is contained in:
@@ -41,12 +41,13 @@ export class AssetUploadService extends BaseService {
|
|||||||
@OnEvent({ name: 'UploadAbort', workers: [ImmichWorker.Api] })
|
@OnEvent({ name: 'UploadAbort', workers: [ImmichWorker.Api] })
|
||||||
onUploadAbort({ assetId, abortTime }: ArgOf<'UploadAbort'>) {
|
onUploadAbort({ assetId, abortTime }: ArgOf<'UploadAbort'>) {
|
||||||
const entry = this.activeRequests.get(assetId);
|
const entry = this.activeRequests.get(assetId);
|
||||||
if (entry && abortTime > entry.startTime) {
|
if (!entry) {
|
||||||
this.activeRequests.delete(assetId);
|
return false;
|
||||||
entry.req.destroy();
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
return false;
|
if (abortTime > entry.startTime) {
|
||||||
|
entry.req.destroy();
|
||||||
|
}
|
||||||
|
return this.activeRequests.delete(assetId);
|
||||||
}
|
}
|
||||||
|
|
||||||
async startUpload(auth: AuthDto, req: Readable, res: Response, dto: StartUploadDto): Promise<void> {
|
async startUpload(auth: AuthDto, req: Readable, res: Response, dto: StartUploadDto): Promise<void> {
|
||||||
|
|||||||
Reference in New Issue
Block a user