Skip to content

Commit

Permalink
Merge 2dbf22e into 9446caa
Browse files Browse the repository at this point in the history
  • Loading branch information
Flix6x committed Apr 12, 2024
2 parents 9446caa + 2dbf22e commit 062a15e
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions flexmeasures/cli/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from flask.cli import with_appcontext
from rq import Queue, Worker
from sqlalchemy.orm import configure_mappers
from tabulate import tabulate

from flexmeasures.data.services.scheduling import handle_scheduling_exception
from flexmeasures.data.services.forecasting import handle_forecasting_exception
Expand Down Expand Up @@ -98,10 +99,23 @@ def show_queues():
"""

configure_mappers()
for q in app.queues.values():
click.echo(
f"Queue {q.name} has {q.count} jobs (and {q.failed_job_registry.count} jobs have failed)."
queue_data = [
(
q.name,
q.started_job_registry.count,
q.count,
q.deferred_job_registry.count,
q.scheduled_job_registry.count,
q.failed_job_registry.count,
)
for q in app.queues.values()
]
click.echo(
tabulate(
queue_data,
headers=["Queue", "Started", "Queued", "Deferred", "Scheduled", "Failed"],
)
)


@fm_jobs.command("clear-queue")
Expand Down

0 comments on commit 062a15e

Please sign in to comment.