-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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: user facing task queues #25138
base: develop
Are you sure you want to change the base?
Conversation
82af7f5
to
0e41468
Compare
0e41468
to
4b08426
Compare
8d710ac
to
f29e739
Compare
f29e739
to
0ae7939
Compare
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed within 3 days if no further activity occurs, but it only takes a comment to keep a contribution alive :) Also, even if it is closed, you can always reopen the PR when you're ready. Thank you for contributing. |
5b1a251
to
dc0a2b2
Compare
53e62ac
to
38c150d
Compare
Basically a combination of callable.__module__ + . + callable.__qualname__ Signed-off-by: Akhil Narang <me@akhilnarang.dev>
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
Make use of `rq.Job`'s `meta` field instead of relying on `kwargs` -> `Job._kwargs` - doesn't seem to be reliable when a job is killed Signed-off-by: Akhil Narang <me@akhilnarang.dev>
Cleanup some code Set status to started when starting Signed-off-by: Akhil Narang <me@akhilnarang.dev>
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
Ensure that the status is set even if an exception occurs Signed-off-by: Akhil Narang <me@akhilnarang.dev>
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
Display a dialog, allow users to customize the values before retrying Signed-off-by: Akhil Narang <me@akhilnarang.dev>
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
38c150d
to
e71cb36
Compare
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
e71cb36
to
93dd647
Compare
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
if task_id: | ||
frappe.db.set_value( | ||
"Background Task", | ||
{"task_id": task_id.split("::")[-1]}, |
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.
Lets avoid site name here. Should be possible.
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.
Also move this up so before_job
doesn't get commited.
:param message: Message for the user | ||
:return: Nothing | ||
""" | ||
from frappe.core.doctype.background_task.background_task import publish_task_progress |
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.
If we want to make this an API (and other functions in the same file) it should probably be moved / re-exported somewhere else.
], | ||
"fields": [ | ||
{ | ||
"fieldname": "task_id", |
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.
Can just use name
for this?
frappe.msgprint(_("Job is not running."), title=_("Invalid Operation")) | ||
|
||
|
||
@frappe.whitelist(methods=["POST"]) |
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.
@frappe.whitelist(methods=["POST"]) |
"read_only": 1 | ||
}, | ||
{ | ||
"fieldname": "stopped_callback", |
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.
lets remove all the callbacks. No one uses it afaik. Also it's elegant to handle this stuff in job itself.
Dev facing APIs that this should have: Queuing the task:
While running the task:
|
We should auto-subscribe all ongoing tasks so updates are sent even if user reloads the page. E.g. prepared report completion should be notified ALWAYS. Another case to consider:
This should behave like notification |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed within 3 days if no further activity occurs, but it only takes a comment to keep a contribution alive :) Also, even if it is closed, you can always reopen the PR when you're ready. Thank you for contributing. |
WIP
Resolves #23008