Skip to content

Conversation

@Flix6x
Copy link
Contributor

@Flix6x Flix6x commented Dec 15, 2025

Description

  • Keep around finished forecasting jobs just as long as the FLEXMEASURES_PLANNING_TTL config setting for scheduling jobs
  • Added changelog item in documentation/changelog.rst

Look & Feel

Finished forecasting jobs were disappearing after the default result_ttl of 500 seconds. They now remain in the finished job registry just as long as scheduling jobs.

How to test

Set the FLEXMEASURES_PLANNING_TTL to 10 seconds and run a forecasting job while checking rq-dashboard.

Related Items

…finished forecasting job longer

Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
@Flix6x Flix6x added this to the 0.30.2 milestone Dec 15, 2025
@Flix6x Flix6x requested a review from BelhsanHmida December 15, 2025 15:16
@Flix6x Flix6x self-assigned this Dec 15, 2025
Signed-off-by: F.N. Claessen <felix@seita.nl>
@read-the-docs-community
Copy link

Documentation build overview

📚 flexmeasures | 🛠️ Build #30700883 | 📁 Comparing fb0b840 against latest (08d77fa)


🔍 Preview build

Show files changed (2 files in total): 📝 2 modified | ➕ 0 added | ➖ 0 deleted
File Status
changelog.html 📝 modified
api/v3_0.html 📝 modified

@BelhsanHmida
Copy link
Contributor

Looking at the current call sites, both FLEXMEASURES_JOB_TTL and
FLEXMEASURES_PLANNING_TTL are immediately used with .total_seconds()
and default to timedelta(-1).

Based on this, the expected format is implicitly a datetime.timedelta.
Other formats (e.g. int or string values like "PT2D") are not supported
by the current implementation and will fail at runtime (e.g.
AttributeError: 'int' object has no attribute 'total_seconds').

So at the moment, the effective contract is that
FLEXMEASURES_*_TTL must be set as a timedelta in the config, which
doesn’t seem ideal from a user perspective.

It might be worth addressing this by accepting either an int (days)
or an ISO-8601 duration string, while keeping the current defaults.

@BelhsanHmida
Copy link
Contributor

Looking at the current call sites, both FLEXMEASURES_JOB_TTL and FLEXMEASURES_PLANNING_TTL are immediately used with .total_seconds() and default to timedelta(-1).

Based on this, the expected format is implicitly a datetime.timedelta. Other formats (e.g. int or string values like "PT2D") are not supported by the current implementation and will fail at runtime (e.g. AttributeError: 'int' object has no attribute 'total_seconds').

So at the moment, the effective contract is that FLEXMEASURES_*_TTL must be set as a timedelta in the config, which doesn’t seem ideal from a user perspective.

It might be worth addressing this by accepting either an int (days) or an ISO-8601 duration string, while keeping the current defaults.

i made this pr as fix for this issue #1882

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants