Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transcode to a temporary file which is only moved when finished #659

Merged
merged 1 commit into from
Oct 12, 2024

Conversation

chvp
Copy link
Member

@chvp chvp commented Oct 10, 2024

Fixes #652.

  • I've added tests relevant to my changes.

@chvp chvp added the chore Repository or build maintenance label Oct 10, 2024
@chvp
Copy link
Member Author

chvp commented Oct 10, 2024

@robbevp Tempfile.create could not be used because ffmpeg then complains about the file already existing. So I went for this alternative approach. (Still need to add tests, but that will be for saturday.)

@chvp chvp force-pushed the chore/do-transcode-to-tmpfile branch from 3e0c12a to 57a099c Compare October 10, 2024 20:52
@robbevp
Copy link
Member

robbevp commented Oct 11, 2024

I agree with the approach. I mostly pushed for Tempfile.create so we can rely on the OS to clean up files in case of issues, but Dir.tmpdir has the same benefit

app/models/audio_file.rb Outdated Show resolved Hide resolved
@chvp chvp force-pushed the chore/do-transcode-to-tmpfile branch from 57a099c to 9bf8318 Compare October 12, 2024 19:20
@chvp chvp force-pushed the chore/do-transcode-to-tmpfile branch from 9bf8318 to 7520a4a Compare October 12, 2024 19:22
@chvp chvp marked this pull request as ready for review October 12, 2024 19:23
@chvp chvp requested a review from robbevp October 12, 2024 19:23
@chvp chvp enabled auto-merge (squash) October 12, 2024 19:58
@chvp chvp merged commit 377b01f into main Oct 12, 2024
4 checks passed
@chvp chvp deleted the chore/do-transcode-to-tmpfile branch October 12, 2024 20:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Repository or build maintenance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tweak CreateTranscodeJob to transcode to a temporary file and only move to the final location when finished
2 participants