From c5da20780e4578b2715794a694d13e438155751d Mon Sep 17 00:00:00 2001 From: Michael Andreen Date: Sun, 13 Sep 2009 18:04:26 +0200 Subject: [PATCH] Also signal bots on launch confirmations --- lib/NDWeb.pm | 4 ++++ lib/NDWeb/Controller/Members.pm | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) 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; -- 2.39.2