Module: Dkdeploy::Helpers::MySQL

Defined in:
lib/dkdeploy/helpers/mysql.rb

Overview

Helpers for MySQL slow_log tasks

Instance Method Summary collapse

Instance Method Details

#slow_log_exists?(file_path) ⇒ Boolean

checks for existence of mysql_sloq_log on server and prints error message if not present

Parameters:

  • file_path (String)

Returns:

  • (Boolean)


12
13
14
15
16
17
# File 'lib/dkdeploy/helpers/mysql.rb', line 12

def slow_log_exists?(file_path)
  return true if !file_path.empty? && test("[ -f #{file_path} ]")

  error I18n.t('file.not_exists_or_not_accessible_on_host', file: file_path, host: server, scope: :dkdeploy)
  false
end