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

[TaskProcessing] Add manager::runTask method #47522

Merged
merged 2 commits into from
Aug 27, 2024

Conversation

julien-nc
Copy link
Member

Add OCP\TaskProcessing\IManager::runTask method to run tasks synchronously.

  • If the provider is synchronous (Php), the task runs in the same process.
  • If not, runTask polls the task that should be picked by an external provider ASAP.

The changeset looks big but it's just moving stuff from the background job to the manager and refactoring the manager a bit to factorize stuff between scheduleTask and runTask.

Additional change: Fix the condition to reschedule the background job. As discussed with @kyteinsky, knowing that some synchronous providers can handle currently scheduled tasks is not enough. They have to be a preferred provider (selected in the AI admin settings).

This should be backported to stable30.

…onously

Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
@bigcat88
Copy link
Member

just to clarify, this doesn't affect our APIs in any way, everything remains compatible with what we did - is it just adding a synchronous method?

@julien-nc
Copy link
Member Author

@bigcat88 Yes, just adding something.

@julien-nc
Copy link
Member Author

/backport to stable30

…dJob

Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
@julien-nc julien-nc force-pushed the enh/noid/taskprocessing-runtask branch from 4b849ef to 396b8f5 Compare August 27, 2024 12:59
@AndyScherzinger
Copy link
Member

@julien-nc is there a way for the old, synchronous API to call this new one? or the implementation behind it? This way the mobile apps won't have to migrate right away (which would else also need to be managed right away now).

@julien-nc
Copy link
Member Author

@AndyScherzinger I would have to check with Marcel. IMO it could work, we would only do it for the hardcoded task types in text processing.

@julien-nc julien-nc enabled auto-merge August 27, 2024 15:24
@julien-nc julien-nc merged commit 558877c into master Aug 27, 2024
171 checks passed
@julien-nc julien-nc deleted the enh/noid/taskprocessing-runtask branch August 27, 2024 15:53
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