departurerb / departure

Percona's pt-online-schema-change runner for ActiveRecord migrations.
Other
141 stars 53 forks source link

Don't try to read error message from file if we writing to stderr #73

Closed dmmatson closed 2 years ago

dmmatson commented 3 years ago

This is a follow up from: https://github.com/departurerb/departure/pull/63

If redirect_stderr = false then we shouldn't attempt to read an error message from departure_error.log since 1) it won't exist 2) we've been writing stderr to stdout the whole time anyway.

Fixes this error that prints if a migration fails:

rails aborted!
StandardError: An error has occurred, all later migrations canceled:

Errno::ENOENT: No such file or directory @ rb_sysopen - /home/app/tmp/departure_error.log: