Update settings changes handling

This commit is contained in:
DariusIII
2024-11-03 10:09:51 +01:00
parent 4a7d5cddd8
commit a83b48ce54
2 changed files with 4 additions and 42 deletions
+4 -4
View File
@@ -1274,18 +1274,18 @@ class NNTP extends \Net_NNTP_Client
/**
* Connect to a NNTP server.
*
* @param string $host (optional) The address of the NNTP-server to connect to, defaults to 'localhost'.
* @param string|null $host (optional) The address of the NNTP-server to connect to, defaults to 'localhost'.
* @param mixed $encryption (optional) Use TLS/SSL on the connection?
* (string) 'tcp' => Use no encryption.
* 'ssl', 'sslv3', 'tls' => Use encryption.
* (null)|(false) Use no encryption.
* @param int $port (optional) The port number to connect to, defaults to 119.
* @param int $timeout (optional) How many seconds to wait before giving up when connecting.
* @param int|null $port (optional) The port number to connect to, defaults to 119.
* @param int|null $timeout (optional) How many seconds to wait before giving up when connecting.
* @param int $socketTimeout (optional) How many seconds to wait before timing out the (blocked) socket.
* @return mixed (bool) On success: True when posting allowed, otherwise false.
* (object) On failure: pear_error
*/
public function connect(?string $host = null, $encryption = null, ?int $port = null, int $timeout = 15, int $socketTimeout = 120)
public function connect(?string $host = null, $encryption = null, ?int $port = null, ?int $timeout = 15, int $socketTimeout = 120): mixed
{
if ($this->_isConnected()) {
return $this->throwError('Already connected, disconnect first!', null);
-38
View File
@@ -51,9 +51,6 @@ class TmuxRun extends Tmux
case 'fixnames':
$this->_runFixReleaseNames($runVar);
break;
case 'import':
$this->_runNZBImport($runVar);
break;
case 'main':
$this->_runMainNon($runVar);
break;
@@ -91,9 +88,6 @@ class TmuxRun extends Tmux
case 'fixnames':
$this->_runFixReleaseNames($runVar);
break;
case 'import':
$this->_runNZBImport($runVar);
break;
case 'main':
$this->_runMainBasic($runVar);
break;
@@ -387,38 +381,6 @@ class TmuxRun extends Tmux
}
}
/**
* @throws \Exception
*/
protected function _runNZBImport(&$runVar): void
{
switch ($runVar['settings']['import']) {
case 1:
$useFilenames = 'false';
break;
case 2:
$useFilenames = 'true';
break;
default:
$useFilenames = 'false';
}
if (((int) $runVar['settings']['import'] !== 0) && ($runVar['killswitch']['pp'] === false)) {
$log = $this->writelog($runVar['panes']['zero'][1]);
shell_exec(
"tmux respawnp -t{$runVar['constants']['tmux_session']}:0.1 ' \
{$runVar['commands']['_phpn']} {$runVar['paths']['misc']}update/multiprocessing/import.php {$runVar['settings']['nzbs']} {$runVar['settings']['nzbthreads']} true true {$useFilenames} {$runVar['settings']['import_count']} $log; \
date +\"{$this->_dateFormat}\"; {$runVar['commands']['_sleep']} {$runVar['settings']['import_timer']}' 2>&1 1> /dev/null"
);
} elseif ($runVar['killswitch']['pp'] === true) {
$color = $this->get_color($runVar['settings']['colors_start'], $runVar['settings']['colors_end'], $runVar['settings']['colors_exc']);
shell_exec("tmux respawnp -k -t{$runVar['constants']['tmux_session']}:0.1 'echo \"\033[38;5;{$color}m\n{$runVar['panes']['zero'][1]} has been disabled/terminated by Exceeding Limits\"'");
} else {
$color = $this->get_color($runVar['settings']['colors_start'], $runVar['settings']['colors_end'], $runVar['settings']['colors_exc']);
shell_exec("tmux respawnp -k -t{$runVar['constants']['tmux_session']}:0.1 'echo \"\033[38;5;{$color}m\n{$runVar['panes']['zero'][1]} has been disabled/terminated by Import\"'");
}
}
/**
* Run postprocess_releases additional.
*