Skip to content

Commit

Permalink
Bug 1861260 - Update the Push extension to add additional status chec…
Browse files Browse the repository at this point in the history
…k code in order to restart the pod if an error is occurring
  • Loading branch information
dklawren authored Oct 27, 2023
1 parent 69283b2 commit ce7841c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
13 changes: 13 additions & 0 deletions extensions/Push/lib/Daemon.pm
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ use warnings;
use Bugzilla::Constants;
use Bugzilla::Extension::Push::Push;
use Bugzilla::Extension::Push::Logger;
use Bugzilla::Util qw(get_text);

use Carp qw(confess);
use Daemon::Generic;
use File::Basename;
Expand Down Expand Up @@ -95,4 +97,15 @@ sub gd_run {
$push->start();
}

sub gd_check {
my $self = shift;
my $dbh = Bugzilla->dbh;

# Get a count of all the push jobs currently in the queue.
my $push_count = $dbh->selectrow_array('SELECT COUNT(*) FROM push');
my $backlog_count = $dbh->selectrow_array('SELECT COUNT(*) FROM push_backlog');
print get_text('push_queue_depth', {count => $push_count}) . "\n";
print get_text('push_queue_backlog_depth', {count => $backlog_count}) . "\n";
}

1;
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,10 @@
[% ELSIF message_tag == "push_message_deleted" %]
The message has been deleted.

[% ELSIF message_tag == "push_queue_depth" %]
[% count FILTER html %] push jobs in the queue.

[% ELSIF message_tag == "push_queue_backlog_depth" %]
[% count FILTER html %] push jobs in the backlog queue.

[% END %]

0 comments on commit ce7841c

Please sign in to comment.