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

try foreasting and scheduling jobs for up to one day #198

Merged
merged 3 commits into from Oct 1, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions documentation/changelog.rst
Expand Up @@ -23,6 +23,7 @@ Infrastructure / Support
* Set default timezone for new users using the FLEXMEASURES_TIMEZONE config setting [see `PR #190 <http://www.github.com/SeitaBV/flexmeasures/pull/190>`_]
* Monitored CLI tasks can get better names for identification [see `PR #193 <http://www.github.com/SeitaBV/flexmeasures/pull/193>`_]
* Less custom logfile location, document logging for devs [see `PR #196 <http://www.github.com/SeitaBV/flexmeasures/pull/196>`_]
* Keep forecasting and scheduling jobs in the queues for only up to one day [see `PR #198 <http://www.github.com/SeitaBV/flexmeasures/pull/198>`_]


v0.6.1 | September XX, 2021
Expand Down
1 change: 1 addition & 0 deletions flexmeasures/data/services/forecasting.py
Expand Up @@ -108,6 +108,7 @@ def create_forecasting_jobs(
custom_model_params=custom_model_params,
),
connection=current_app.queues["forecasting"].connection,
ttl=24 * 60 * 60, # try up to one day
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks to me like this should be a config setting rather than be hard coded. I'd also prefer to set the config setting as a timedelta (like FLEXMEASURES_PLANNING_TTL) and calling .total_seconds() on it here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It looks that way to me too, but I'm afraid of having too many config settings.

)
job.meta["model_search_term"] = model_search_term
job.save_meta()
Expand Down
1 change: 1 addition & 0 deletions flexmeasures/data/services/scheduling.py
Expand Up @@ -64,6 +64,7 @@ def create_scheduling_job(
),
id=udi_event_ea,
connection=current_app.queues["scheduling"].connection,
ttl=24 * 60 * 60, # try up to one day
result_ttl=int(
current_app.config.get(
"FLEXMEASURES_PLANNING_TTL", timedelta(-1)
Expand Down