1.1.3 autoextension and autofinish subscribes

This commit is contained in:
SDE
2024-05-31 15:03:15 +03:00
parent 11bbfd0e73
commit dbfc39639b
6 changed files with 89 additions and 4 deletions

View File

View File

@@ -0,0 +1,31 @@
from django.core.management.base import BaseCommand
from datetime import datetime
from BaseModels.mailSender import techSendMail
from GeneralApp.funcs_options import get_options_by_opt_types, get_mail_send_options
class Command(BaseCommand):
def handle(self, *args, **options):
mail_sets = get_mail_send_options()
log = ''
log_begin_DT = datetime.now()
msg = str(log_begin_DT)
print('-------------')
print(msg)
try:
from SubscribesApp.funcs import finish_user_subscribes, extension_free_subscribes
extension_free_subscribes()
finish_user_subscribes()
except Exception as e:
msg = f'every_day_start fail = {str(e)}'
print(msg)
techSendMail(mail_sets, msg, title='every_day_start fail')
# if msg:
# techSendMail(mail_sets, str(msg), title='every_1hour_start get_competitors_prices')
print(f'- processing time = {str(datetime.now() - log_begin_DT)} -')