diff --git a/bin/monitor.php b/bin/monitor.php index 907b6340f..56a7fcd03 100644 --- a/bin/monitor.php +++ b/bin/monitor.php @@ -1483,12 +1483,12 @@ while ($i > 0) { } $log = writelog($panes0[1]); shell_exec("tmux respawnp -t${tmux_session}:0.1 'echo \"\033[38;5;${color}m\"; \ - cd $_bin && $_php postprocess_new.php additional true $log; date +\"%D %T\"; $_sleep $post_timer' 2>&1 1> /dev/null" + cd $_bin && $_php postprocess.php additional true $log; date +\"%D %T\"; $_sleep $post_timer' 2>&1 1> /dev/null" ); } else if (($post == 2) && ($nfo_remaining_now > 0)) { $log = writelog($panes0[1]); shell_exec("tmux respawnp -t${tmux_session}:0.1 ' \ - cd $_bin && $_php postprocess_new.php nfo true $log; date +\"%D %T\"; $_sleep $post_timer' 2>&1 1> /dev/null" + cd $_bin && $_php postprocess.php nfo true $log; date +\"%D %T\"; $_sleep $post_timer' 2>&1 1> /dev/null" ); } else if (($post == 3) && (($nfo_remaining_now > 0) || ($work_remaining_now + $pc_releases_proc + $xxx_releases_proc > 0))) { //run postprocess_releases additional @@ -1510,8 +1510,8 @@ while ($i > 0) { } $log = writelog($panes0[1]); shell_exec("tmux respawnp -t${tmux_session}:0.1 ' \ - cd $_bin && $_php postprocess_new.php additional true $log;\ - cd $_bin && $_php postprocess_new.php nfo true $log; date +\"%D %T\"; $_sleep $post_timer' 2>&1 1> /dev/null" + cd $_bin && $_php postprocess.php additional true $log;\ + cd $_bin && $_php postprocess.php nfo true $log; date +\"%D %T\"; $_sleep $post_timer' 2>&1 1> /dev/null" ); } else if (($post != 0) && ($nfo_remaining_now == 0) && ($work_remaining_now + $pc_releases_proc + $xxx_releases_proc == 0)) { $color = get_color($colors_start, $colors_end, $colors_exc); @@ -1616,11 +1616,11 @@ while ($i > 0) { } - //runs postprocess_new.php nfo in pane 2.0 + //runs postprocess.php nfo in pane 2.0 if (($maxload >= get_load()) && (($post == 0) || ($post == 1)) && ($nfo_remaining_now > 0)) { $log = writelog($panes2[0]); shell_exec("tmux respawnp -t${tmux_session}:2.0 ' \ - cd $_bin && $_php postprocess_new.php nfo true $log; date +\"%D %T\"; $_sleep $post_timer' 2>&1 1> /dev/null" + cd $_bin && $_php postprocess.php nfo true $log; date +\"%D %T\"; $_sleep $post_timer' 2>&1 1> /dev/null" ); } else if (($maxload >= get_load()) && (($post == 0) || ($post == 1)) && ($nfo_remaining_now == 0)) { $color = get_color($colors_start, $colors_end, $colors_exc); @@ -1638,10 +1638,10 @@ while ($i > 0) { //run postprocess_releases non amazon $log = writelog($panes2[1]); shell_exec("tmux respawnp -t${tmux_session}:2.1 ' \ - cd $_bin && $_php postprocess_new.php tv true $clean $log;\ - $_php postprocess_new.php movies true $clean $log;\ - $_php postprocess_new.php anime true 2>&1 $log;\ - $_php postprocess_new.php xxx true 2>&1 $log; date +\"%D %T\"; $_sleep $post_timer_non' 2>&1 1> /dev/null" + cd $_bin && $_php postprocess.php tv true $clean $log;\ + $_php postprocess.php movies true $clean $log;\ + $_php postprocess.php anime true 2>&1 $log;\ + $_php postprocess.php xxx true 2>&1 $log; date +\"%D %T\"; $_sleep $post_timer_non' 2>&1 1> /dev/null" ); } else if (($post_non != 0) && ($tvrage_releases_proc == 0 || $movie_releases_proc = 0 || $xxx_releases_proc = 0)) { $color = get_color($colors_start, $colors_end, $colors_exc); @@ -1658,10 +1658,10 @@ while ($i > 0) { if (($maxload >= get_load()) && ($post_amazon == 1) && ($music_releases_proc > 0 || $console_releases_proc > 0 || $pc_releases_proc > 0 || $book_releases_proc > 0)) { $color = get_color($colors_start, $colors_end, $colors_exc); $log = writelog($panes2[2]); - shell_exec("tmux respawnp -t${tmux_session}:2.2 'echo \"\033[38;5;\"$color\"m\" && cd $_bin && $_php postprocess_new.php music true 2>&1 $log; \ - $_php postprocess_new.php console true 2>&1 $log;\ - $_php postprocess_new.php games true 2>&1 $log;\ - $_php postprocess_new.php book true 2>&1 $log && $_sleep $post_timer_amazon' 2>&1 1> /dev/null"); + shell_exec("tmux respawnp -t${tmux_session}:2.2 'echo \"\033[38;5;\"$color\"m\" && cd $_bin && $_php postprocess.php music true 2>&1 $log; \ + $_php postprocess.php console true 2>&1 $log;\ + $_php postprocess.php games true 2>&1 $log;\ + $_php postprocess.php book true 2>&1 $log && $_sleep $post_timer_amazon' 2>&1 1> /dev/null"); } else if (($maxload >= get_load()) && ($post_amazon == 1) && ($music_releases_proc == 0 || $console_releases_proc == 0 || $pc_releases_proc == 0 || $book_releases_proc == 0)) { $color = get_color($colors_start, $colors_end, $colors_exc); shell_exec("tmux respawnp -t${tmux_session}:2.2 'echo \"\033[38;5;${color}m\n${panes2[2]} has been disabled/terminated by No Amazon to process\"'"); @@ -1867,7 +1867,7 @@ function run_sharing($tmux_session, $_php, $pane, $_sleep, $sharing_timer) if ($tmux_share && $sharing['enabled'] == 1 && ($sharing['posting'] == 1 || $sharing['fetching'] == 1)) { if (shell_exec("tmux list-panes -t${tmux_session}:${pane} | grep ^0 | grep -c dead") == 1) { $DIR = dirname(__FILE__); - $sharing2 = $DIR . "/postprocess_new.php sharing true"; + $sharing2 = $DIR . "/postprocess.php sharing true"; shell_exec( "tmux respawnp -t${tmux_session}:${pane}.0 ' \ $_php $sharing2; $_sleep $sharing_timer' 2>&1 1> /dev/null" diff --git a/bin/postprocess_new.php b/bin/postprocess.php similarity index 71% rename from bin/postprocess_new.php rename to bin/postprocess.php index 9de78aa7d..01b4306f5 100644 --- a/bin/postprocess_new.php +++ b/bin/postprocess.php @@ -48,21 +48,21 @@ if (!isset($argv[1]) || !in_array($argv[1], $args) || !isset($argv[2]) || !in_ar $pdo->log->error( "\nIncorrect arguments.\n" . "The second argument (true/false) determines wether to echo or not.\n\n" - . "php postprocess_new.php all true ...: Does all the types of post processing.\n" - . "php postprocess_new.php pre true ...: Processes all Predb sites.\n" - . "php postprocess_new.php nfo true ...: Processes NFO files.\n" - . "php postprocess_new.php movies true ...: Processes movies.\n" - . "php postprocess_new.php music true ...: Processes music.\n" - . "php postprocess_new.php console true ...: Processes console games.\n" - . "php postprocess_new.php games true ...: Processes games.\n" - . "php postprocess_new.php book true ...: Processes books.\n" - . "php postprocess_new.php anime true ...: Processes anime.\n" - . "php postprocess_new.php tv true ...: Processes tv.\n" - . "php postprocess_new.php xxx true ...: Processes xxx.\n" - . "php postprocess_new.php additional true ...: Processes previews/mediainfo/etc...\n" - . "php postprocess_new.php sharing true ...: Processes uploading/downloading comments.\n" - . "php postprocess_new.php allinf true ...: Does all the types of post processing on a loop, sleeping 15 seconds between.\n" - . "php postprocess_new.php amazon true ...: Does all the amazon (books/console/games/music/xxx).\n" + . "php postprocess.php all true ...: Does all the types of post processing.\n" + . "php postprocess.php pre true ...: Processes all Predb sites.\n" + . "php postprocess.php nfo true ...: Processes NFO files.\n" + . "php postprocess.php movies true ...: Processes movies.\n" + . "php postprocess.php music true ...: Processes music.\n" + . "php postprocess.php console true ...: Processes console games.\n" + . "php postprocess.php games true ...: Processes games.\n" + . "php postprocess.php book true ...: Processes books.\n" + . "php postprocess.php anime true ...: Processes anime.\n" + . "php postprocess.php tv true ...: Processes tv.\n" + . "php postprocess.php xxx true ...: Processes xxx.\n" + . "php postprocess.php additional true ...: Processes previews/mediainfo/etc...\n" + . "php postprocess.php sharing true ...: Processes uploading/downloading comments.\n" + . "php postprocess.php allinf true ...: Does all the types of post processing on a loop, sleeping 15 seconds between.\n" + . "php postprocess.php amazon true ...: Does all the amazon (books/console/games/music/xxx).\n" ) ); } diff --git a/bin/postprocess_alpha.php b/bin/postprocess_threaded.php similarity index 96% rename from bin/postprocess_alpha.php rename to bin/postprocess_threaded.php index fbc1b5ad2..19a711a76 100644 --- a/bin/postprocess_alpha.php +++ b/bin/postprocess_threaded.php @@ -21,7 +21,7 @@ $torun = $tmux->get()->post; $pieces = explode(' =+= ', $argv[1]); -$postprocess = new PProcess('Echo'); +$postprocess = new PProcess(['Echo' => true]); if (isset($pieces[6])) { // Create the connection here and pass $nntp = new NNTP(); diff --git a/python/postprocess_threaded.py b/python/postprocess_threaded.py index 21e670d8f..4a4036ebd 100644 --- a/python/postprocess_threaded.py +++ b/python/postprocess_threaded.py @@ -232,7 +232,7 @@ class queue_runner(threading.Thread): else: if my_ID: time_of_last_run = time.time() - subprocess.call(["php", pathname+"/../bin/postprocess_alpha.php", ""+my_ID]) + subprocess.call(["php", pathname+"/../bin/postprocess_threaded.php", ""+my_ID]) time.sleep(.02) self.my_queue.task_done()