more worker

This commit is contained in:
mahdavi 2020-11-02 00:26:45 +03:30
parent 0e994d7f7a
commit 099b99fd7a
2 changed files with 7 additions and 6 deletions

View file

@ -2,6 +2,11 @@ from celery import shared_task
from django.conf import settings
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
def send_notification(phone_number=None,
@ -10,11 +15,7 @@ def send_notification(phone_number=None,
user_uuid=None,
email=None,
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 = {
'phone_number': phone_number,
"body": f'{title}:\n{body}'

2
run.sh
View file

@ -1,3 +1,3 @@
python3 manage.py collectstatic
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