diff --git a/Changelog b/Changelog index c24370770..44636310e 100755 --- a/Changelog +++ b/Changelog @@ -1,4 +1,5 @@ 2017-12-18 DariusIII + * Chg: Remove complete sequential mode * Chg: Remove screen scripts completely, they were not maintaned and not up-to-date * Chg: Remove requestid lookup settings from site edit * Chg: Remove spotnab from nntmux, update PostProcess class diff --git a/misc/update/tmux/monitor.php b/misc/update/tmux/monitor.php index 054918435..0350bfb44 100644 --- a/misc/update/tmux/monitor.php +++ b/misc/update/tmux/monitor.php @@ -2,6 +2,7 @@ require_once dirname(__DIR__, 3).DIRECTORY_SEPARATOR.'bootstrap/autoload.php'; +use nntmux\ColorCLI; use nntmux\Tmux; use nntmux\db\DB; use nntmux\TmuxRun; @@ -58,7 +59,7 @@ $runVar['timers']['query']['tpg1_time'] = 0; // Analyze release table if not using innoDB (innoDB uses online analysis) $engine = $pdo->queryOneRow(sprintf("SELECT ENGINE FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = %s AND TABLE_NAME = 'releases'", $pdo->escapeString($db_name))); if (! in_array($engine['engine'], ['InnoDB', 'TokuDB'], false)) { - printf($pdo->log->info(PHP_EOL.'Analyzing your tables to refresh your indexes.')); + printf(ColorCLI::info(PHP_EOL.'Analyzing your tables to refresh your indexes.')); $pdo->optimise(false, 'analyze', false, ['releases']); Utility::clearScreen(); } @@ -118,17 +119,17 @@ while ($runVar['counts']['iterations'] > 0) { unset($runVar['conncounts']); $runVar['conncounts'] = $tOut->getUSPConnections('primary', $runVar['connections']); - if ($runVar['constants']['alternate_nntp'] == 1) { + if ((int) $runVar['constants']['alternate_nntp'] === 1) { $runVar['conncounts'] += $tOut->getUSPConnections('alternate', $runVar['connections']); } //run queries only after time exceeded, these queries can take awhile - if ($runVar['counts']['iterations'] == 1 || (time() - $runVar['timers']['timer2'] >= $runVar['settings']['monitor'] && $runVar['settings']['is_running'] == 1)) { + if ((int) $runVar['counts']['iterations'] === 1 || (time() - $runVar['timers']['timer2'] >= $runVar['settings']['monitor'] && $runVar['settings']['is_running'] == 1)) { $runVar['counts']['proc1'] = $runVar['counts']['proc2'] = $runVar['counts']['proc3'] = $splitqry = $newOldqry = false; $runVar['counts']['now']['total_work'] = 0; - $runVar['modsettings']['fix_crap'] = explode(', ', ($runVar['settings']['fix_crap'])); + $runVar['modsettings']['fix_crap'] = explode(', ', $runVar['settings']['fix_crap']); - echo $pdo->log->info("\nThe numbers(queries) above are currently being refreshed. \nNo pane(script) can be (re)started until these have completed.\n"); + echo ColorCLI::info("\nThe numbers(queries) above are currently being refreshed. \nNo pane(script) can be (re)started until these have completed.\n"); $timer02 = time(); $splitqry = $newOldqry = ''; @@ -271,16 +272,16 @@ while ($runVar['counts']['iterations'] > 0) { // Zero out any post proc counts when that type of pp has been turned off foreach ($runVar['settings'] as $settingkey => $setting) { - if (strpos($settingkey, 'process') == 0 && $setting == 0) { + if ((int) $setting === 0 && (int) strpos($settingkey, 'process') === 0) { $runVar['counts']['now'][$settingkey] = $runVar['counts']['start'][$settingkey] = 0; } - if ($settingkey == 'fix_names' && $setting == 0) { + if ($settingkey === 'fix_names' && (int) $setting === 0) { $runVar['counts']['now']['processrenames'] = $runVar['counts']['start']['processrenames'] = 0; } } //set initial start postproc values from work queries -- this is used to determine diff variables - if ($runVar['counts']['iterations'] == 1) { + if ((int) $runVar['counts']['iterations'] === 1) { $runVar['counts']['start'] = $runVar['counts']['now']; } @@ -302,7 +303,7 @@ while ($runVar['counts']['iterations'] > 0) { $runVar['counts']['now']['total_work'] += $runVar['counts']['now']['work']; // Set initial total work count for diff - if ($runVar['counts']['iterations'] == 1) { + if ((int) $runVar['counts']['iterations'] === 1) { $runVar['counts']['start']['total_work'] = $runVar['counts']['now']['total_work']; } @@ -311,16 +312,8 @@ while ($runVar['counts']['iterations'] > 0) { } //set kill switches - $runVar['killswitch']['pp'] = ( - ($runVar['settings']['postprocess_kill'] < $runVar['counts']['now']['total_work']) && ($runVar['settings']['postprocess_kill'] != 0) - ? true - : false - ); - $runVar['killswitch']['coll'] = ( - ($runVar['settings']['collections_kill'] < $runVar['counts']['now']['collections_table']) && ($runVar['settings']['collections_kill'] != 0) - ? true - : false - ); + $runVar['killswitch']['pp'] = (($runVar['settings']['postprocess_kill'] < $runVar['counts']['now']['total_work']) && ((int) $runVar['settings']['postprocess_kill'] !== 0)); + $runVar['killswitch']['coll'] = (($runVar['settings']['collections_kill'] < $runVar['counts']['now']['collections_table']) && ((int) $runVar['settings']['collections_kill'] !== 0)); $tOut->updateMonitorPane($runVar); @@ -346,7 +339,7 @@ while ($runVar['counts']['iterations'] > 0) { $tRun->runPane('updatetv', $runVar); //run these if complete sequential not set - if ($runVar['constants']['sequential'] != 2) { + if ((int) $runVar['constants']['sequential'] !== 2) { //fix names $tRun->runPane('fixnames', $runVar); @@ -363,12 +356,12 @@ while ($runVar['counts']['iterations'] > 0) { //run postprocess_releases non amazon $tRun->runPane('nonamazon', $runVar); } - } elseif ($runVar['settings']['is_running'] === '0') { + } elseif ((int) $runVar['settings']['is_running'] === 0) { $tRun->runPane('notrunning', $runVar); } $exit = Settings::settingValue('tmux.running.exit'); - if ($exit == 0) { + if ((int) $exit === 0) { $runVar['counts']['iterations']++; sleep(10); } else { @@ -377,11 +370,9 @@ while ($runVar['counts']['iterations'] > 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); + echo ColorCLI::error(PHP_EOL.'Monitor encountered severe errors retrieving process data from MySQL. Please diagnose and try running again.'.PHP_EOL); exit; } diff --git a/nntmux/TmuxRun.php b/nntmux/TmuxRun.php index fae0d4364..f7227c67c 100755 --- a/nntmux/TmuxRun.php +++ b/nntmux/TmuxRun.php @@ -121,31 +121,6 @@ class TmuxRun extends Tmux break; } break; - case 2: - switch ($cmdParam) { - case 'amazon': - $this->_runAmazonFull($runVar); - break; - case 'import': - $this->_runNZBImport($runVar); - break; - case 'main': - $this->_runMainFull($runVar); - break; - case 'notrunning': - $this->_notRunningFull($runVar); - break; - case 'scraper': - $this->_runIRCScraper(2, $runVar); - break; - case 'sharing': - $this->_runSharing(3, $runVar); - break; - case 'updatetv': - $this->_runUpdateTvFull($runVar); - break; - } - break; } } @@ -678,18 +653,6 @@ class TmuxRun extends Tmux } } - /** - * @param $runVar - */ - protected function _runMainFull(&$runVar) - { - $log = $this->writelog($runVar['panes']['zero'][2]); - shell_exec( - "tmux respawnp -t{$runVar['constants']['tmux_session']}:0.2 ' \ - {$runVar['paths']['misc']}update/screen/sequential/user_threaded.sh true $log; date +\"{$this->_dateFormat}\"' 2>&1 1> /dev/null" - ); - } - /** * @param $runVar */ diff --git a/public/admin/tmux-edit.php b/public/admin/tmux-edit.php index d82fe43d0..bc59e942a 100644 --- a/public/admin/tmux-edit.php +++ b/public/admin/tmux-edit.php @@ -12,20 +12,20 @@ $id = 0; $action = $_REQUEST['action'] ?? 'view'; switch ($action) { - case 'submit': - $error = ''; - $ret = $tmux->update($_POST); - $page->title = 'Tmux Settings Edit'; - $settings = $tmux->get(); - $page->smarty->assign('ftmux', $settings); - break; + case 'submit': + $error = ''; + $ret = $tmux->update($_POST); + $page->title = 'Tmux Settings Edit'; + $settings = $tmux->get(); + $page->smarty->assign('ftmux', $settings); + break; - case 'view': - default: - $page->title = 'Tmux Settings Edit'; - $settings = $tmux->get(); - $page->smarty->assign('ftmux', $settings); - break; + case 'view': + default: + $page->title = 'Tmux Settings Edit'; + $settings = $tmux->get(); + $page->smarty->assign('ftmux', $settings); + break; } $page->smarty->assign('yesno_ids', [1, 0]); @@ -49,8 +49,8 @@ $page->smarty->assign('fix_crap_radio_ids', ['Disabled', 'All', 'Custom']); $page->smarty->assign('fix_crap_radio_names', ['Disabled', 'All', 'Custom']); $page->smarty->assign('fix_crap_check_ids', ['blacklist', 'blfiles', 'executable', 'gibberish', 'hashed', 'installbin', 'passworded', 'passwordurl', 'sample', 'scr', 'short', 'size', 'huge', 'nzb', 'codec']); $page->smarty->assign('fix_crap_check_names', ['blacklist', 'blfiles', 'executable', 'gibberish', 'hashed', 'installbin', 'passworded', 'passwordurl', 'sample', 'scr', 'short', 'size', 'huge', 'nzb', 'codec']); -$page->smarty->assign('sequential_ids', [0, 1, 2]); -$page->smarty->assign('sequential_names', ['Disabled', 'Basic Sequential', 'Complete Sequential']); +$page->smarty->assign('sequential_ids', [0, 1]); +$page->smarty->assign('sequential_names', ['Disabled', 'Enabled']); $page->smarty->assign('binaries_ids', [0, 1, 2]); $page->smarty->assign('binaries_names', ['Disabled', 'Simple Threaded Update', 'Complete Threaded Update']); $page->smarty->assign('lookup_reqids_ids', [0, 1, 2]); diff --git a/public/themes/admin/tmux-edit.tpl b/public/themes/admin/tmux-edit.tpl index e061a5b31..f60a6027f 100644 --- a/public/themes/admin/tmux-edit.tpl +++ b/public/themes/admin/tmux-edit.tpl @@ -142,7 +142,7 @@ {html_options style="width:180px;" class="siteeditstyle" id="sequential" name='sequential' values=$sequential_ids output=$sequential_names selected=$ftmux->sequential} -
Basic Sequential runs update_binaries, backfill and update releases_sequentially.
Changing +
Sequential runs update_binaries, backfill and update releases_sequentially.
Changing requires restart.