add message

This commit is contained in:
baoliang 2020-11-18 23:37:22 +08:00
parent bea89a06ba
commit a240ba852b
1 changed files with 5 additions and 3 deletions

View File

@ -15,14 +15,16 @@ def process_notify_task():
now = datetime.now()
if two_hours_later < now:
phone = n.user.username
print(phone)
today = now.date()
hour = now.hour
exists = SMSNotifyRecord.objects.filter(
phone=phone, added=today, notice_id=n.id).exists()
print(exists)
if exists:
return
if hour < 8 or hour > 20:
return
break
if hour < 8 or hour > 24:
break
print('============', phone, n.type, n.id)
SMSNotifyRecord.objects.create(phone=phone, notice_id=n.id)
sent_sms_notify(phone, n.type)