Class: AppCommand::Fix
- Inherits:
-
Convoy::ActionCommand::Base
- Object
- Convoy::ActionCommand::Base
- AppCommand::Fix
- Defined in:
- lib/routes/fix.rb
Instance Method Summary collapse
Instance Method Details
#clear_sessions ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/routes/fix.rb', line 32 def clear_sessions App::Terminal::info('Attempting to clear all sessions from DB..') App::Terminal::output('DELETE FROM _session.session;') @mysql_ses.query('DELETE FROM session;') App::Terminal::output('DELETE FROM app.session_to_licence_type;') @mysql_app.query('DELETE FROM session_to_licence_type;') App::Terminal::output('DELETE FROM app.sessions;') @mysql_app.query('DELETE FROM sessions;') puts end |
#execute ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/routes/fix.rb', line 5 def execute @opts = @args = arguments @mysql_app = App::MySQL::vm @mysql_ses = App::MySQL::vm('_session') opts_validate opts_routing end |
#opts_routing ⇒ Object
22 23 24 25 26 27 28 29 30 |
# File 'lib/routes/fix.rb', line 22 def opts_routing if @opts[:clear_sessions] clear_sessions else system('bp f -h') end end |
#opts_validate ⇒ Object
18 19 20 |
# File 'lib/routes/fix.rb', line 18 def opts_validate end |