FileExists: returns the path, not file digest.
This commit is contained in:
parent
c926e5334a
commit
de53bf59a2
@ -42,10 +42,10 @@ class FileStorage::Errors
|
||||
JSONIPC.request FileExists, 204 do
|
||||
property mid : String
|
||||
property reason = "file already present"
|
||||
property filedigest : String
|
||||
property path : String
|
||||
property next_chunk : Int32
|
||||
|
||||
def initialize(@mid, @filedigest, @next_chunk)
|
||||
def initialize(@mid, @path, @next_chunk)
|
||||
end
|
||||
end
|
||||
FileStorage.errors << FileExists
|
||||
|
@ -112,6 +112,9 @@ class FileStorage::Storage
|
||||
rescue e : IndexError
|
||||
# In case the file was completely uploaded already.
|
||||
return FileStorage::Errors::FileFullyUploaded.new mid, file_digest
|
||||
rescue e
|
||||
puts "error during transfer_info.chunks.sort.first"
|
||||
raise e
|
||||
end
|
||||
end
|
||||
|
||||
@ -192,7 +195,7 @@ class FileStorage::Storage
|
||||
# in this case: ignore the upload request.
|
||||
begin
|
||||
next_chunk = transfer_info.chunks.sort.first
|
||||
return FileStorage::Errors::FileExists.new mid, file_digest, next_chunk
|
||||
return FileStorage::Errors::FileExists.new mid, path, next_chunk
|
||||
rescue e : IndexError
|
||||
# In case the file was completely uploaded already.
|
||||
return FileStorage::Errors::FileFullyUploaded.new mid, file_digest
|
||||
|
Loading…
Reference in New Issue
Block a user