-
-
Notifications
You must be signed in to change notification settings - Fork 775
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
137 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -266,7 +266,7 @@ <h5 class="text-center card-user_name"> | |
{% include 'shared/analytics.html' %} | ||
{% include 'shared/footer_scripts.html' with slim="1" %} | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/vuex/3.5.1/vuex.min.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/innersearch.min.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/vue-innersearch.min.js"></script> | ||
<script> | ||
$('body').bootstrapTooltip({ | ||
selector: '[data-toggle="tooltip"]' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
from django.conf import settings | ||
from django.contrib.contenttypes.models import ContentType | ||
|
||
from app.services import RedisService | ||
from celery import app, group | ||
from celery.utils.log import get_task_logger | ||
from marketing.mails import new_bounty_daily as new_bounty_daily_email | ||
from marketing.mails import weekly_roundup as weekly_roundup_email | ||
from marketing.models import EmailSubscriber | ||
|
||
logger = get_task_logger(__name__) | ||
|
||
redis = RedisService().redis | ||
|
||
|
||
@app.shared_task(bind=True, max_retries=1) | ||
def new_bounty_daily(self, email_subscriber_id, retry: bool = True) -> None: | ||
""" | ||
:param self: | ||
:param pk: | ||
:return: | ||
""" | ||
es = EmailSubscriber.objects.get(pk=email_subscriber_id) | ||
new_bounty_daily_email(es) | ||
|
||
@app.shared_task(bind=True, max_retries=1) | ||
def weekly_roundup(self, to_email, retry: bool = True) -> None: | ||
""" | ||
:param self: | ||
:param pk: | ||
:return: | ||
""" | ||
weekly_roundup_email([to_email]) | ||
|
||
|
||
|
||
@app.shared_task(bind=True, max_retries=1) | ||
def send_all_weekly_roundup(self, retry: bool = True) -> None: | ||
""" | ||
:param self: | ||
:param pk: | ||
:return: | ||
""" | ||
#THROTTLE_S = 0.005 | ||
#import time | ||
queryset = EmailSubscriber.objects.all() | ||
email_list = list(set(queryset.values_list('email', flat=True))) | ||
for to_email in email_list: | ||
weekly_roundup.delay(to_email) | ||
#time.sleep(THROTTLE_S) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters