Skip to content

Always enable RQ embedded scheduler in flexmeasures jobs run-worker#2112

Open
Ragnar-the-mighty wants to merge 1 commit intoFlexMeasures:mainfrom
Ragnar-the-mighty:fix/rq-scheduler-always-on
Open

Always enable RQ embedded scheduler in flexmeasures jobs run-worker#2112
Ragnar-the-mighty wants to merge 1 commit intoFlexMeasures:mainfrom
Ragnar-the-mighty:fix/rq-scheduler-always-on

Conversation

@Ragnar-the-mighty
Copy link
Copy Markdown
Contributor

Summary

Context

Closes #2105

Made with Cursor

Pass with_scheduler=True to Worker.work() and log startup line so
enqueue_in jobs are promoted when due. Document under v0.32.0 bugfixes
(issue FlexMeasures#2105).

Made-with: Cursor
@read-the-docs-community
Copy link
Copy Markdown

Documentation build overview

📚 flexmeasures | 🛠️ Build #32283997 | 📁 Comparing 7656b7b against latest (e97a0c4)

  🔍 Preview build  

2 files changed
± changelog.html
± api/v3_0.html

Bugfixes
-----------
* Fix the Swagger endpoint for fetching a schedule [see `PR #2109 <https://www.github.com/FlexMeasures/flexmeasures/pull/2109>`_]
* Run ``flexmeasures jobs run-worker`` with RQ's embedded scheduler always on so jobs created with ``enqueue_in`` are promoted from the scheduled registry when due [see `issue #2105 <https://github.com/FlexMeasures/flexmeasures/issues/2105>`_]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should go under v0.33.0: Infrastructure / Support.

Bugfixes
-----------
* Fix the Swagger endpoint for fetching a schedule [see `PR #2109 <https://www.github.com/FlexMeasures/flexmeasures/pull/2109>`_]
* Run ``flexmeasures jobs run-worker`` with RQ's embedded scheduler always on so jobs created with ``enqueue_in`` are promoted from the scheduled registry when due [see `issue #2105 <https://github.com/FlexMeasures/flexmeasures/issues/2105>`_]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We cross-reference PRs in our changelog rather than issues. So this would be PR #2112.

Comment thread flexmeasures/cli/jobs.py
click.echo("=========================================================\n")

worker.work()
worker.work(with_scheduler=True)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest making this a CLI option (flag) so hosts still have the option to turn it on/off should things go south. On by default is fine.

@click.option(
    "--with-scheduler/--without-scheduler",
    "with_scheduler",
    default=True,
    help="...",
)
...
Suggested change
worker.work(with_scheduler=True)
worker.work(with_scheduler=with_scheduler)

And please amend the click.echo accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable RQ embedded scheduler in flexmeasures jobs run-worker (enqueue_in jobs stuck)

2 participants