diff options
author | Michael Kozono <mkozono@gmail.com> | 2017-11-18 00:49:25 +0300 |
---|---|---|
committer | Michael Kozono <mkozono@gmail.com> | 2017-12-02 02:26:41 +0300 |
commit | 17ce21d74eab4d2973d372cb3f97258eb3b81de9 (patch) | |
tree | 1c4706f2175c5f92e65991dad8675fe2e0a3ab90 | |
parent | f5fa39872402c7f27307ffe9bd769c4f120a0f2e (diff) |
Use ionice absolute path
-rw-r--r-- | lib/gitlab/background_migration/prepare_untracked_uploads.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/gitlab/background_migration/prepare_untracked_uploads.rb b/lib/gitlab/background_migration/prepare_untracked_uploads.rb index 853c9810359..c3f5dddb07d 100644 --- a/lib/gitlab/background_migration/prepare_untracked_uploads.rb +++ b/lib/gitlab/background_migration/prepare_untracked_uploads.rb @@ -80,14 +80,15 @@ module Gitlab def build_find_command(search_dir) cmd = %W[find #{search_dir} -type f ! ( -path #{EXCLUDED_HASHED_UPLOADS_PATH} -prune ) ! ( -path #{EXCLUDED_TMP_UPLOADS_PATH} -prune ) -print0] - cmd = %w[ionice -c Idle] + cmd if ionice_is_available? + ionice = which_ionice + cmd = %W[#{ionice} -c Idle] + cmd if ionice Rails.logger.info "PrepareUntrackedUploads find command: \"#{cmd.join(' ')}\"" cmd end - def ionice_is_available? + def which_ionice Gitlab::Utils.which('ionice') rescue StandardError # In this case, returning false is relatively safe, even though it isn't very nice |