Use Celery instead of RQ.
Celery provides a more robust set of queueing options for both tasks and worker processes. Updates include: - infrastructure necessary to run Celery, including celery entrypoint - backgrounded functions are now imported directly from atst.jobs - update tests as-needed - update kubernetes worker pod command
This commit is contained in:
@@ -14,7 +14,7 @@ from atst.forms.team import TeamForm
|
||||
from atst.models import Permissions
|
||||
from atst.utils.flash import formatted_flash as flash
|
||||
from atst.utils.localization import translate
|
||||
from atst.queue import queue
|
||||
from atst.jobs import send_mail
|
||||
|
||||
|
||||
def get_form_permission_value(member, edit_perm_set):
|
||||
@@ -129,7 +129,7 @@ def send_application_invitation(invitee_email, inviter_name, token):
|
||||
body = render_template(
|
||||
"emails/application/invitation.txt", owner=inviter_name, token=token
|
||||
)
|
||||
queue.send_mail(
|
||||
send_mail.delay(
|
||||
[invitee_email],
|
||||
translate("email.application_invite", {"inviter_name": inviter_name}),
|
||||
body,
|
||||
|
||||
@@ -15,7 +15,7 @@ from atst.domain.exceptions import AlreadyExistsError, NotFoundError
|
||||
from atst.domain.users import Users
|
||||
from atst.domain.permission_sets import PermissionSets
|
||||
from atst.forms.data import SERVICE_BRANCHES
|
||||
from atst.queue import queue
|
||||
from atst.jobs import send_mail
|
||||
from atst.utils import pick
|
||||
|
||||
|
||||
@@ -174,7 +174,7 @@ def dev_new_user():
|
||||
|
||||
@bp.route("/test-email")
|
||||
def test_email():
|
||||
queue.send_mail(
|
||||
send_mail.delay(
|
||||
[request.args.get("to")], request.args.get("subject"), request.args.get("body")
|
||||
)
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ from atst.domain.exceptions import AlreadyExistsError
|
||||
from atst.domain.invitations import PortfolioInvitations
|
||||
from atst.domain.portfolios import Portfolios
|
||||
from atst.models import Permissions
|
||||
from atst.queue import queue
|
||||
from atst.jobs import send_mail
|
||||
from atst.utils.flash import formatted_flash as flash
|
||||
from atst.utils.localization import translate
|
||||
import atst.forms.portfolio_member as member_forms
|
||||
@@ -16,7 +16,7 @@ def send_portfolio_invitation(invitee_email, inviter_name, token):
|
||||
body = render_template(
|
||||
"emails/portfolio/invitation.txt", owner=inviter_name, token=token
|
||||
)
|
||||
queue.send_mail(
|
||||
send_mail.delay(
|
||||
[invitee_email],
|
||||
translate("email.portfolio_invite", {"inviter_name": inviter_name}),
|
||||
body,
|
||||
|
||||
Reference in New Issue
Block a user