tidy debuging in DXCron
authorDirk Koopman <djk@tobit.co.uk>
Fri, 17 Apr 2020 01:59:49 +0000 (02:59 +0100)
committerDirk Koopman <djk@tobit.co.uk>
Fri, 17 Apr 2020 01:59:49 +0000 (02:59 +0100)
Change UPGRADE.mojo to reflect no longer using Mojo::IOLoop::ForkCall

UPGRADE.mojo
perl/DXCron.pm

index c6d3d3390f658e0b6c66895bd67d7735579c54ff..1c18f3a1f7e61a61b5e9b1f8dd4212dc6e44535e 100644 (file)
@@ -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:
index ae9feb32000c1e09c84d8403ce4a651432ddaca6..c011d7b3d3e3df0740bfbdc3662edd6646b95d30 100644 (file)
@@ -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');
        }
 }