H
H
hackuun2018-07-19 15:53:33
Node.js
hackuun, 2018-07-19 15:53:33

How to wait for the file to be saved?

I use the library for Node node-fluent-ffmpeg
. I create a file in two formats, wrapped the functions in promises.
I do

Promise.all([makeWebm(file, slug), makeMp4(file, slug)])

And then thenI work with the file further. So, sometimes, after a time, referring to the newly created file, thenI throw an error
Error: ENOENT: no such file or directory,
. The file is naturally there, but at that moment, I believe it is still saved to the disk (having opened the explorer, I see by the icon that the file is still being processed for several milliseconds) . What to do in this case? Well, do not write the same timeout.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question