more worker
This commit is contained in:
parent
0e994d7f7a
commit
099b99fd7a
2 changed files with 7 additions and 6 deletions
|
|
@ -2,6 +2,11 @@ from celery import shared_task
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from service_clients import Client, AccountsClient
|
from service_clients import Client, AccountsClient
|
||||||
|
|
||||||
|
SCOPES = ['notifications.notification:submit']
|
||||||
|
client = Client(client_id=settings.CLIENT_ID,
|
||||||
|
client_secret=settings.CLIENT_SECRET,
|
||||||
|
scopes=SCOPES,
|
||||||
|
grant_type=AccountsClient.GRANT_CLIENT_CREDENTIALS)
|
||||||
|
|
||||||
@shared_task
|
@shared_task
|
||||||
def send_notification(phone_number=None,
|
def send_notification(phone_number=None,
|
||||||
|
|
@ -10,11 +15,7 @@ def send_notification(phone_number=None,
|
||||||
user_uuid=None,
|
user_uuid=None,
|
||||||
email=None,
|
email=None,
|
||||||
notification_type=1):
|
notification_type=1):
|
||||||
SCOPES = ['notifications.notification:submit']
|
|
||||||
client = Client(client_id=settings.CLIENT_ID,
|
|
||||||
client_secret=settings.CLIENT_SECRET,
|
|
||||||
scopes=SCOPES,
|
|
||||||
grant_type=AccountsClient.GRANT_CLIENT_CREDENTIALS)
|
|
||||||
data = {
|
data = {
|
||||||
'phone_number': phone_number,
|
'phone_number': phone_number,
|
||||||
"body": f'{title}:\n{body}'
|
"body": f'{title}:\n{body}'
|
||||||
|
|
|
||||||
2
run.sh
2
run.sh
|
|
@ -1,3 +1,3 @@
|
||||||
python3 manage.py collectstatic
|
python3 manage.py collectstatic
|
||||||
python3 manage.py migrate
|
python3 manage.py migrate
|
||||||
gunicorn gooyal_accounts.wsgi:application --bind 0.0.0.0:8000
|
gunicorn gooyal_accounts.wsgi:application --bind 0.0.0.0:8000 -w 4
|
||||||
Loading…
Add table
Reference in a new issue