From 9a67a730f3d0d5b816c7802e8fea7970aa45ed87 Mon Sep 17 00:00:00 2001 From: KRKeegan Date: Tue, 19 Nov 2013 21:10:53 -0800 Subject: [PATCH] Add 2 Second Delay and Print Log Message to Restart Command Allows for the web interface to at least see that the command was successfully sent, before the http server goes offline. --- code/common/mh_control.pl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/code/common/mh_control.pl b/code/common/mh_control.pl index 20b40423a..dd0a41d0d 100644 --- a/code/common/mh_control.pl +++ b/code/common/mh_control.pl @@ -103,7 +103,13 @@ () $v_restart_mh->set_info( 'Restarts Misterhouse. This will only work if ' . 'you start with mh/bin/mhl') if !$OS_win; $v_restart_mh->set_info('Restarts Misterhouse.') if $OS_win; -$v_restart_mh->tie_event('&exit_pgm(1)'); # noloop +$v_restart_mh->tie_event('&restart_mh()'); # noloop + +sub restart_mh{ + $exit_timer = new Timer; + print_log "MisterHouse will restart in 2 seconds."; + $exit_timer->set(2, '&exit_pgm(1)'); +} # This will be abend. # Allow for no msg on first time use where this flag is not set yet.