fix(sms): manual campaign grace period 30min for link_ready (FIX-4 was never applied)
This commit is contained in:
parent
2fda27a329
commit
eb1b39e035
|
|
@ -124,8 +124,9 @@ def get_groups_to_manual(conn):
|
||||||
AND og.first_sms_sent_at < NOW() - INTERVAL '3 hours'
|
AND og.first_sms_sent_at < NOW() - INTERVAL '3 hours'
|
||||||
AND og.second_sms_sent_at IS NOT NULL)
|
AND og.second_sms_sent_at IS NOT NULL)
|
||||||
-- 3. link_ready + next_check в прошлом + нет активных SMS в логе
|
-- 3. link_ready + next_check в прошлом + нет активных SMS в логе
|
||||||
|
-- FIX-4: grace period 30 мин — manual не крадёт свежие link_ready до first_campaign
|
||||||
OR (COALESCE(og.notification_status, '') = 'link_ready'
|
OR (COALESCE(og.notification_status, '') = 'link_ready'
|
||||||
AND (og.next_notification_check_at IS NULL OR og.next_notification_check_at <= NOW())
|
AND (og.next_notification_check_at IS NULL OR og.next_notification_check_at <= NOW() - INTERVAL '30 minutes')
|
||||||
AND NOT EXISTS (
|
AND NOT EXISTS (
|
||||||
SELECT 1 FROM sms_campaign_log scl
|
SELECT 1 FROM sms_campaign_log scl
|
||||||
WHERE scl.order_group_id = og.id
|
WHERE scl.order_group_id = og.id
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue