-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Closes 20817 fix datasource sync broken when cron is set #20837
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
base: main
Are you sure you want to change the base?
Closes 20817 fix datasource sync broken when cron is set #20837
Conversation
This reverts commit b4160ad.
|
@ifoughal, CI appears to be failing with a test failure. |
|
Initially I thought there was an issue with the view rendering class, but after some further TS, and checking the actual value of status on the DB entry, it seems the status field got overwritten somehow. To circumvent this, I run the instance.save() method in the save override of dataSourcesForm. but this generates 2 commits and breaks the test. I'll continue looking into a fix. |
|
The issue was coming from : The enqueue method was overriding the state, I have removed |
Fixes: #20817
Datasources sync was broken when the user sets a sync interval.
The fix introduces 2 new states:
Ready state is set when the data-source object is not new. ie: either updated or changed state recently.
Scheduled is set when the user sets a sync interval.
This PR includes the following logic enhancements:
by removing
DataSourceStatusChoices.QUEUEDfrom theready_for_syncmethod, we let the user sync the data-source anytime even when a daily interval is set, as long as the data-source is enabled.Include the 2 new states (Scheduled, Ready) in the clean & save properties of data-source form model, to set the status correctly depending on the user inputs/