From: Dirk Koopman Date: Fri, 17 Apr 2020 01:59:49 +0000 (+0100) Subject: tidy debuging in DXCron X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=commitdiff_plain;h=0be0043ef6c6da167d80a64ae6ae322bd9e6b526;p=spider.git tidy debuging in DXCron Change UPGRADE.mojo to reflect no longer using Mojo::IOLoop::ForkCall --- diff --git a/UPGRADE.mojo b/UPGRADE.mojo index c6d3d339..1c18f3a1 100644 --- a/UPGRADE.mojo +++ b/UPGRADE.mojo @@ -50,10 +50,14 @@ or You will need the following CPAN packages: - sudo cpanm EV Mojolicious Mojo::IOLoop::ForkCall JSON JSON::XS + sudo cpanm EV Mojolicious Sereal JSON JSON::XS # just in case it's missing sudo apt-get install top + +Please make sure that, if you insist on using operating system packages, that your Mojolicious is +at least version 7.40. Mojo::IOLoop::ForkCall is NOT LONGER IN USE! + Login as the sysop user. Edit your /spider/local/DXVars.pm so that the bottom of the file is changed from something like: diff --git a/perl/DXCron.pm b/perl/DXCron.pm index ae9feb32..c011d7b3 100644 --- a/perl/DXCron.pm +++ b/perl/DXCron.pm @@ -62,7 +62,7 @@ sub cread my $line = 0; my @out; - dbg("cron: reading $fn\n") if isdbg('cron'); + dbg("DXCron::cread reading $fn\n") if isdbg('cron'); open($fh, $fn) or confess("cron: can't open $fn $!"); while (<$fh>) { $line++; @@ -81,9 +81,9 @@ sub cread if (!$err) { $ref->{cmd} = $cmd; push @out, $ref; - dbg("cron: adding $_\n") if isdbg('cron'); + dbg("DXCron::cread: adding $_\n") if isdbg('cron'); } else { - dbg("cron: error on line $line '$_'\n") if isdbg('cron'); + dbg("DXCron::cread: error on line $line '$_'\n") if isdbg('cron'); } } close($fh); @@ -269,7 +269,7 @@ sub spawn_cmd { my $line = shift; - dbg("spawn_cmd run: $line") if isdbg('cron'); + dbg("DXCron::spawn_cmd run: $line") if isdbg('cron'); my $fc = Mojo::IOLoop::Subprocess->new(); $fc->run( sub { @@ -281,12 +281,12 @@ sub spawn_cmd sub { my ($fc, $err, @res) = @_; if ($err) { - my $s = "spawn_cmd: error $err"; + my $s = "DXCron::spawn_cmd: error $err"; dbg($s); } for (@res) { chomp; - dbg("spawn_cmd: $_") if isdbg("cron"); + dbg("DXCron::spawn_cmd: $_") if isdbg("cron"); } } ); @@ -310,10 +310,10 @@ sub run_cmd { my $line = shift; my @in = $main::me->run_cmd($line); - dbg("cmd run: $line") if isdbg('cron'); + dbg("DXCron::run_cmd: $line") if isdbg('cron'); for (@in) { s/\s*$//og; - dbg("cmd out: $_") if isdbg('cron'); + dbg("DXCron::cmd out: $_") if isdbg('cron'); } }