acd: Work around 408 REQUEST_TIMEOUT and 504 GATEWAY_TIMEOUT errors

Amazon Drive sometimes returns errors at the end of large uploads

  * 408 REQUEST_TIMEOUT
  * 504 GATEWAY_TIMEOUT
  * 500 Internal error

The file may have been uploaded correctly though, so, on error, wait
for up to 2 minutes for it to appear if it was fully
uploaded (configure timeout with --acd-upload-wait-time).

Issues: #601 #605 #606
This commit is contained in:
Nick Craig-Wood
2016-08-05 23:42:49 +01:00
parent 3f7107839e
commit 4f9e805d44
2 changed files with 70 additions and 1 deletions

View File

@@ -532,7 +532,7 @@ func TestObjectUpdate(t *testing.T) {
file1.Size = int64(buf.Len())
obj := findObject(t, file1.Path)
obji := fs.NewStaticObjectInfo("", file1.ModTime, file1.Size, true, nil, obj.Fs())
obji := fs.NewStaticObjectInfo(file1.Path, file1.ModTime, file1.Size, true, nil, obj.Fs())
err := obj.Update(in, obji)
require.NoError(t, err)
file1.Hashes = hash.Sums()