diff options
| author | Paul Buetow <paul@buetow.org> | 2022-04-21 23:45:23 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2022-04-21 22:59:05 +0100 |
| commit | ce255ff5a1257db57424603caac2b4bfca3c7694 (patch) | |
| tree | 9f5c3a9222555270ae7d3ebccd2d4da27e3f1e87 /lib | |
| parent | db2bf4b9dbe3388e074a1144ac3f0e9b04d43b96 (diff) | |
release v1.3develop
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/PerlDaemon/Logger.pm | 3 | ||||
| -rw-r--r-- | lib/PerlDaemon/PerlDaemon.pl | 6 | ||||
| -rw-r--r-- | lib/PerlDaemon/RunModules.pm | 2 | ||||
| -rw-r--r-- | lib/PerlDaemonModules/ExampleModule.pm | 7 | ||||
| -rw-r--r-- | lib/PerlDaemonModules/ExampleModule2.pm | 7 |
5 files changed, 5 insertions, 20 deletions
diff --git a/lib/PerlDaemon/Logger.pm b/lib/PerlDaemon/Logger.pm index a5d632d..0cf9c65 100644 --- a/lib/PerlDaemon/Logger.pm +++ b/lib/PerlDaemon/Logger.pm @@ -18,7 +18,6 @@ sub new ($$) { die "Instance already exists" if defined $SELF; $SELF = bless { conf => $conf }, $class; - $SELF->{queue} = []; return $SELF; @@ -29,13 +28,11 @@ sub logmsg ($$) { my $conf = $self->{conf}; my $logline = localtime()." (PID $$): $msg\n"; - { lock $self->{queue}; push @{$self->{queue}}, $logline; } $self->flushlogs(); - return undef; } diff --git a/lib/PerlDaemon/PerlDaemon.pl b/lib/PerlDaemon/PerlDaemon.pl index af848dc..3f5765a 100644 --- a/lib/PerlDaemon/PerlDaemon.pl +++ b/lib/PerlDaemon/PerlDaemon.pl @@ -1,7 +1,5 @@ #!/usr/bin/perl -# PerlDaemon (c) 2010, 2011, Dipl.-Inform. (FH) Paul Buetow (http://perldaemon.buetow.org) - use strict; use warnings; @@ -166,7 +164,7 @@ sub daemonloop ($) { my $timediff = tv_interval($lastrun, $now); if ($timediff >= $loopinterval) { - $lastrun = $now; + $lastrun = $now; $rmodule->do(); alive $conf; } @@ -218,5 +216,3 @@ if ($conf->{'daemon.daemonize'} ne 'yes') { sighandlers $conf; daemonloop $conf; - - diff --git a/lib/PerlDaemon/RunModules.pm b/lib/PerlDaemon/RunModules.pm index 147325a..8caf858 100644 --- a/lib/PerlDaemon/RunModules.pm +++ b/lib/PerlDaemon/RunModules.pm @@ -1,5 +1,3 @@ -# PerlDaemon (c) 2010, 2011, 2015, Dipl.-Inform. (FH) Paul Buetow (http://perldaemon.buetow.org) - package PerlDaemon::RunModules; use strict; diff --git a/lib/PerlDaemonModules/ExampleModule.pm b/lib/PerlDaemonModules/ExampleModule.pm index 8e61f12..1c0e671 100644 --- a/lib/PerlDaemonModules/ExampleModule.pm +++ b/lib/PerlDaemonModules/ExampleModule.pm @@ -1,5 +1,3 @@ -# PerlDaemon (c) 2010, 2011, 2015, Dipl.-Inform. (FH) Paul Buetow (http://perldaemon.buetow.org) - package PerlDaemonModules::ExampleModule; use strict; @@ -9,9 +7,8 @@ sub new ($$$) { my ($class, $conf) = @_; my $self = bless { conf => $conf }, $class; - - # Store some private persistent module stuff - $self->{counter} = 0; + # Store some private persistent module stuff + $self->{counter} = 0; return $self; } diff --git a/lib/PerlDaemonModules/ExampleModule2.pm b/lib/PerlDaemonModules/ExampleModule2.pm index eaa5702..81b663b 100644 --- a/lib/PerlDaemonModules/ExampleModule2.pm +++ b/lib/PerlDaemonModules/ExampleModule2.pm @@ -1,5 +1,3 @@ -# PerlDaemon (c) 2010, 2011, 2015, Dipl.-Inform. (FH) Paul Buetow (http://perldaemon.buetow.org) - package PerlDaemonModules::ExampleModule2; use strict; @@ -9,9 +7,8 @@ sub new ($$$) { my ($class, $conf) = @_; my $self = bless { conf => $conf }, $class; - - # Store some private persistent module stuff - $self->{counter} = 0; + # Store some private persistent module stuff + $self->{counter} = 0; return $self; } |
