Your workflow is unique 👨💻 - tell us how you use Dropbox here.
Forum Discussion
ijunaid8989
6 years agoExplorer | Level 3
too many write operations when uploading files
I am using Elixir wrapper to DropboxAPI to upload files, which is doing simple upload using `files/upload` route. def upload(client, path, file, mode \\ "add", autorename \\ true, mute \\ false) d...
ijunaid8989
6 years agoExplorer | Level 3
Okay thanks for all your help and replies, right now what I am doing is:
client = ElixirDropbox.Client.new(System.get_env["DROP_BOX_TOKEN"])
{:ok, file_size} = get_file_size(image_path)
%{"session_id" => session_id} = ElixirDropbox.Files.UploadSession.start(client, false, image_path)
ElixirDropbox.Files.UploadSession.finish(client, session_id, upload_image_path, image_path, file_size) |> handle_upload_responseI still got one error as
"error_summary\": \"too_many_write_operations/\", \"error\": {\"reason\": {\".tag\": \"too_many_write_operations\"and 5 errors are API timed out.
I have no idea why still there is too many write operations error? where as I am right now first starting the session, then finishing it in a proper way?
but these requests almost goes in parallel, should I need to change something as well? more..
Greg-DB
Dropbox Community Moderator
6 years agoIn this code I see you're using the 'finish' method, presumably once per file, to finish the uploads. If you send off multiple of these at the same time, you will cause lock contention.
You should use a single 'finish_batch' to finish multiple file uploads in a single call to avoid this. (Or, only send the multiple 'finish' calls one at a time.)
About Dropbox API Support and Feedback
Get help with the Dropbox API from fellow developers and experts.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!