]> ruin.nu Git - ndwebbie.git/commitdiff
Also signal bots on launch confirmations
authorMichael Andreen <harv@ruin.nu>
Sun, 13 Sep 2009 16:04:26 +0000 (18:04 +0200)
committerMichael Andreen <harv@ruin.nu>
Sun, 13 Sep 2009 16:04:26 +0000 (18:04 +0200)
lib/NDWeb.pm
lib/NDWeb/Controller/Members.pm

index 1e59f30b970767cbdc807b98138a317fdd0e0fa4..6cb6d67415fa0646dbd329cb0fc0adb0671cacd6 100644 (file)
@@ -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
index b9ae443ce5a994b3ca3e97e034f4608f41919eb6..cfd6d536c62c5a432e66bf6a8c3d66b06ec37c31 100644 (file)
@@ -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;