Update the handling of tmux exit.

This commit is contained in:
Darko
2015-06-12 13:21:38 +02:00
parent 3b8ae20af7
commit d2801f3855
3 changed files with 21 additions and 4 deletions
@@ -369,10 +369,18 @@ while ($runVar['counts']['iterations'] > 0) {
$tRun->runPane('notrunning', $runVar);
}
$runVar['counts']['iterations']++;
sleep(10);
$exit = $pdo->getSetting('tmux.run.exit');
if ($exit == 0) {
$runVar['counts']['iterations']++;
sleep(10);
} else {
// Set counter to less than one so the loop will exit.
$runVar['counts']['iterations'] = ($exit < 0) ? $exit : 0;
}
}
// TODO add code here to handle all panes shutting down before closing.
function errorOnSQL($pdo)
{
echo $pdo->log->error(PHP_EOL . "Monitor encountered severe errors retrieving process data from MySQL. Please diagnose and try running again." . PHP_EOL);
+2 -2
View File
@@ -2,8 +2,8 @@
<newznab>
<versions>
<sql>
<db>156</db>
<file>156</file>
<db>157</db>
<file>157</file>
</sql>
<git>
<tag>0.4.1</tag>
+9
View File
@@ -0,0 +1,9 @@
INSERT INTO settings (section, subsection, name, value, hint, setting)
VALUES (
'tmux',
'running',
'exit',
0,
'Determines if the running tmux monitor script should exit. If 0 nothing changes; if positive the script should exit gracefully (allowing all panes to finish); if negative the script should die as soon as possible.',
'tmux.running.exit'
);