mirror of
https://github.com/logos-storage/logos-storage-nim.git
synced 2026-01-03 14:03:10 +00:00
Return ok when the session does not need to be cancelled
This commit is contained in:
parent
86ab1b2711
commit
f2db1c40b5
@ -249,13 +249,15 @@ proc cancel(
|
||||
## from the table.
|
||||
|
||||
if not uploadSessions.contains($sessionId):
|
||||
return err("Failed to cancel the upload session, session not found: " & $sessionId)
|
||||
# Session not found, nothing to cancel
|
||||
return ok("")
|
||||
|
||||
try:
|
||||
let session = uploadSessions[$sessionId]
|
||||
session.fut.cancelSoon()
|
||||
except KeyError:
|
||||
return err("Failed to cancel the upload session, invalid session ID: " & $sessionId)
|
||||
# Session not found, nothing to cancel
|
||||
return ok("")
|
||||
|
||||
uploadSessions.del($sessionId)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user