Organize uploader storage and restore transfer readiness
This commit is contained in:
@@ -582,9 +582,22 @@ export class Service {
|
||||
},
|
||||
ip: string,
|
||||
storedSource = false,
|
||||
storageUserId?: string,
|
||||
) {
|
||||
this.cleanup();
|
||||
const target = this.deviceGuest(input.targetDeviceId);
|
||||
if (
|
||||
target &&
|
||||
target.guestId !== g.id &&
|
||||
this.device(g.id).discoverable &&
|
||||
!this.presence.active(target.guestId) &&
|
||||
this.canReceive(g.id, target.guestId, false)
|
||||
)
|
||||
fail(
|
||||
409,
|
||||
'TARGET_RECONNECTING',
|
||||
'상대 기기의 연결을 확인하고 있어요. 잠시 후 다시 시도해 주세요.',
|
||||
);
|
||||
if (
|
||||
!target ||
|
||||
target.guestId === g.id ||
|
||||
@@ -656,7 +669,8 @@ export class Service {
|
||||
})
|
||||
.run();
|
||||
this.db.insert(s.batches).values({ id: randomUUID(), requestId: id, status: 'waiting' }).run();
|
||||
if (input.files && !storedSource) this.storage.createManifest(g, id, input.files);
|
||||
if (input.files && !storedSource)
|
||||
this.storage.createManifest(g, id, input.files, storageUserId);
|
||||
return { requestId: id };
|
||||
}
|
||||
request(g: Guest, id: string) {
|
||||
|
||||
Reference in New Issue
Block a user