diff options
author | Dylan William Hardison <dylan@hardison.net> | 2017-12-05 15:16:31 +0100 |
---|---|---|
committer | Dylan William Hardison <dylan@hardison.net> | 2017-12-05 15:17:21 +0100 |
commit | 060d4fa6dd6e98ed45381ddf1e9b9ca2407ab3b3 (patch) | |
tree | d662bdbe13a951299930d45fa69cd20e4c47356b /extensions/PhabBugz/lib/Daemon.pm | |
parent | 83bc5b8c30a68203bc073b82be06585b7b6bd799 (diff) | |
download | bugzilla-060d4fa6dd6e98ed45381ddf1e9b9ca2407ab3b3.tar.gz bugzilla-060d4fa6dd6e98ed45381ddf1e9b9ca2407ab3b3.tar.xz |
Revert "Bug 1409957 - Create polling daemon to query Phabricator for recent transcations and update bug data according to revision changes"
This reverts commit 7da8e374e0c96e10077690935e829b0c04fc82f4.
Diffstat (limited to 'extensions/PhabBugz/lib/Daemon.pm')
-rw-r--r-- | extensions/PhabBugz/lib/Daemon.pm | 100 |
1 files changed, 0 insertions, 100 deletions
diff --git a/extensions/PhabBugz/lib/Daemon.pm b/extensions/PhabBugz/lib/Daemon.pm deleted file mode 100644 index c8b4f73af..000000000 --- a/extensions/PhabBugz/lib/Daemon.pm +++ /dev/null @@ -1,100 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# -# This Source Code Form is "Incompatible With Secondary Licenses", as -# defined by the Mozilla Public License, v. 2.0. - -package Bugzilla::Extension::PhabBugz::Daemon; - -use 5.10.1; -use strict; -use warnings; - -use Bugzilla::Constants; -use Bugzilla::Extension::PhabBugz::Feed; -use Bugzilla::Extension::PhabBugz::Logger; - -use Carp qw(confess); -use Daemon::Generic; -use File::Basename; -use File::Spec; -use Pod::Usage; - -sub start { - newdaemon(); -} - -# -# daemon::generic config -# - -sub gd_preconfig { - my $self = shift; - my $pidfile = $self->{gd_args}{pidfile}; - if (!$pidfile) { - $pidfile = File::Spec->catfile(bz_locations()->{datadir}, $self->{gd_progname} . ".pid"); - } - return (pidfile => $pidfile); -} - -sub gd_getopt { - my $self = shift; - $self->SUPER::gd_getopt(); - if ($self->{gd_args}{progname}) { - $self->{gd_progname} = $self->{gd_args}{progname}; - } else { - $self->{gd_progname} = basename($0); - } - $self->{_original_zero} = $0; - $0 = $self->{gd_progname}; -} - -sub gd_postconfig { - my $self = shift; - $0 = delete $self->{_original_zero}; -} - -sub gd_more_opt { - my $self = shift; - return ( - 'pidfile=s' => \$self->{gd_args}{pidfile}, - 'n=s' => \$self->{gd_args}{progname}, - ); -} - -sub gd_usage { - pod2usage({ -verbose => 0, -exitval => 'NOEXIT' }); - return 0; -}; - -sub gd_redirect_output { - my $self = shift; - - my $filename = File::Spec->catfile(bz_locations()->{datadir}, $self->{gd_progname} . ".log"); - open(STDERR, ">>", $filename) or (print "could not open stderr: $!" && exit(1)); - close(STDOUT); - open(STDOUT, ">&", STDERR) or die "redirect STDOUT -> STDERR: $!"; - $SIG{HUP} = sub { - close(STDERR); - open(STDERR, ">>", $filename) or (print "could not open stderr: $!" && exit(1)); - }; -} - -sub gd_setup_signals { - my $self = shift; - $self->SUPER::gd_setup_signals(); - $SIG{TERM} = sub { $self->gd_quit_event(); } -} - -sub gd_run { - my $self = shift; - $::SIG{__DIE__} = \&Carp::confess if $self->{debug}; - my $phabbugz = Bugzilla::Extension::PhabBugz::Feed->new(); - $phabbugz->is_daemon(1); - $phabbugz->logger( - Bugzilla::Extension::PhabBugz::Logger->new(debugging => $self->{debug})); - $phabbugz->start(); -} - -1; |