Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug 1861260 - Update the Push extension to add additional status check code in order to restart the pod if an error is occurring #2135

Merged
merged 1 commit into from
Oct 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 %]