-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
feat(TaskProcessingApi): Add endpoint for getting the next task #45391
feat(TaskProcessingApi): Add endpoint for getting the next task #45391
Conversation
Ah, I missed this, yes.
Yeah, let's do this manually directly in the endpoint |
5800675
to
6d86511
Compare
We need endpoint for getting nextTask by specifying multiple task_types. Or just to change |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
I agree with @marcelklehr that it makes more sense to change the task status to "running" in the controller method.
TheManager::getNextScheduledTask
method might be used in some context where we don't want to change to task status. -
Also, how about having a
setTaskRunning
parameter (withtrue
as default value) inTaskProcessingApiController::getNextScheduledTask
? Just in case one wants to get the next scheduled task without actually processing it. -
About requesting multiple task types in
getNextScheduledTask
, much needed indeed. @marcelklehr Would you go with another endpoint or change the current one?
I don't see a reason why you would ever need to know the next task without also running it at the same time, but I can change it if you really want 🤷♀️ |
The synchronous background job will re-schedule itself based on the fact whether there is another job waiting to be executed. |
We can add this to the current endpoint. |
711a3fe
to
7e6e94a
Compare
7e6e94a
to
8063ff5
Compare
lib/private/AppFramework/Middleware/Security/SecurityMiddleware.php
Outdated
Show resolved
Hide resolved
lib/private/AppFramework/Middleware/Security/SecurityMiddleware.php
Outdated
Show resolved
Hide resolved
ExApp needs to call these APIs to process tasks:
more precisely, there should be two versions of getFileContents - one for the UI with cause only having those 4 endpoint ExApp can have no "system" flag to process tasks from what I see |
lib/private/AppFramework/Middleware/Security/SecurityMiddleware.php
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The security middleware looks good now
I didn't change the logic inside getNextScheduledTask - but it doesn't seem right to me for these reasons:
|
Signed-off-by: provokateurin <kate@provokateurin.de>
b1cc4fb
to
ed62b4c
Compare
btw Psalm failing is related:
|
Yeah I saw it, will fix all of it |
Signed-off-by: provokateurin <kate@provokateurin.de>
ed62b4c
to
f5ff813
Compare
Summary
The ExApps need a way to get the next task.
@marcelklehr I think there is a bug as the tasks are not marked as running when the getNextScheduledTask method of the service is called (or maybe it was also intentional and the endpoint should do it manually).
Checklist