Fix email issue with bug tracker + add announcements to globster
This commit is contained in:
parent
42c5026131
commit
c661838551
1 changed files with 26 additions and 1 deletions
27
index.cgi
27
index.cgi
|
|
@ -87,7 +87,7 @@ TUWF::register(
|
|||
TUWF::set(
|
||||
logfile => '/www/err.log',
|
||||
error_404_handler => \¬found,
|
||||
mail_from => 'Yorhel\'s Bug Tracker <projects@yorhel.nl>',
|
||||
mail_from => 'Yorhels Bug Tracker <projects@yorhel.nl>',
|
||||
# this is a fairly static site, allow some aggressive caching
|
||||
pre_request_handler => sub { $_[0]->resHeader('Cache-Control', 's-max-age=86400, max-age=3600'); 1; },
|
||||
);
|
||||
|
|
@ -249,6 +249,31 @@ sub bug_post {
|
|||
return $s->htmlFooter;
|
||||
}
|
||||
|
||||
# Experimental: announce this report to the ncdc hub, through the globster bot
|
||||
my $sock = '/tmp/glob.sock';
|
||||
if(-e $sock) {
|
||||
my $msg = "Bug activity for $p: $l->{summary} -> http://dev.yorhel.nl/$p/bug/$l->{issue}";
|
||||
require AnyEvent;
|
||||
require AnyEvent::Handle;
|
||||
require AnyEvent::Socket;
|
||||
require Tanja;
|
||||
my $done = AnyEvent->condvar;
|
||||
my $node = Tanja::Node->new();
|
||||
AnyEvent::Socket::tcp_connect('unix/', $sock, sub {
|
||||
my $fh = shift;
|
||||
warn $! && $done->send if !$fh;
|
||||
my $lnk; $lnk = $fh && $node->link(handle => AnyEvent::Handle->new(fh => $fh),
|
||||
sync => 0,
|
||||
on_error => sub { $_[0]&&warn$_[0]; $done->send },
|
||||
on_ready => sub {
|
||||
$node->send([hub=>ncdc=>chat=>undef,0,$msg]);
|
||||
$lnk->close;
|
||||
},
|
||||
);
|
||||
});
|
||||
$done->recv;
|
||||
}
|
||||
|
||||
$s->resRedirect("/$p/bug/$l->{issue}", 'post');
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue