OregonDigital / oregondigital_2

The active development on Oregon Digital 2 is in the https://github.com/OregonDigital/OD2 repo.
Other
1 stars 1 forks source link

Generate derivatives into /tmp, then copy on completion #292

Open jechols opened 8 years ago

jechols commented 8 years ago

In OD1, when a derivative job is fired off, it immediately writes directly to the final derivative location. Which means if we re-encode a long video, the live asset is broken until that encode job is done. It also means we can't safely kill a resque worker without potentially leaving broken files behind.

It should be trivial to fix this, especially if we build our own derivative processes. We just use mktemp (or Ruby's equivalent), write to that file, and once the derivative job is done successfully, move the file.