From: Michael Andreen Date: Sun, 13 Sep 2009 16:04:26 +0000 (+0200) Subject: Also signal bots on launch confirmations X-Git-Url: https://ruin.nu/git/?p=ndwebbie.git;a=commitdiff_plain;h=c5da20780e4578b2715794a694d13e438155751d Also signal bots on launch confirmations --- diff --git a/lib/NDWeb.pm b/lib/NDWeb.pm index 1e59f30..6cb6d67 100644 --- a/lib/NDWeb.pm +++ b/lib/NDWeb.pm @@ -41,6 +41,10 @@ use Catalyst qw/ our $VERSION = '0.01'; +sub signal_bots { + system 'killall','-USR1', 'ndbot.pl'; +} + # Configure the application. # # Note that settings in ndweb.yml (or other external diff --git a/lib/NDWeb/Controller/Members.pm b/lib/NDWeb/Controller/Members.pm index b9ae443..cfd6d53 100644 --- a/lib/NDWeb/Controller/Members.pm +++ b/lib/NDWeb/Controller/Members.pm @@ -265,7 +265,7 @@ sub postircrequest : Local { INSERT INTO irc_requests (uid,channel,message) VALUES($1,$2,$3) }); $query->execute($c->user->id,$c->req->param('channel'),$c->req->param('message')); - system 'killall','-USR1', 'ndbot.pl'; + $c->signal_bots; $c->flash(reply => "Msg sent to: ".$c->req->param('channel')); $c->res->redirect($c->uri_for('ircrequest')); @@ -574,6 +574,7 @@ sub postconfirmation : Local { } $dbh->commit; $c->flash(missions => \@missions); + $c->signal_bots; }; if ($@){ $dbh->rollback;