Commit 5f406156 authored by Harsh Chouraria's avatar Harsh Chouraria Committed by Achilleas Pipinellis

Change pending jobs command to print count

The command added in
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/75388
and then subsequently updated in
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/78242
is attempting to print out an active record collection
(with `pending` being an activerecord enum status match helper)
that has not any usable printing inside it
(only Ruby Object IDs are printed)

Since the goal of these commands is to check for
any actual pending jobs continuing to exist
even outside of the Sidekiq jobs queue
the command could be updated to print the
count of matching status records

Alternatively the following can be used to identify the
actual pending classes and their arguments that
have not yet completed:

```
gitlab-rails runner -e production \
'puts Gitlab::Database::BackgroundMigrationJob.pending.map do |x|
  [x.class_name, x.arguments]
end'
```
parent 56b78e45
......@@ -98,7 +98,7 @@ that can process jobs in the `background_migration` queue.
```shell
sudo gitlab-rails runner -e production 'puts Gitlab::BackgroundMigration.remaining'
sudo gitlab-rails runner -e production 'puts Gitlab::Database::BackgroundMigrationJob.pending'
sudo gitlab-rails runner -e production 'puts Gitlab::Database::BackgroundMigrationJob.pending.count'
```
**For installations from source:**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment