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
with cte as ( | |
select ap.accounting_point_uid | |
-- s.parent_uid is null as "self_managed", s.*, '########', ap.indexed_data->'confirmed_at', ap.indexed_data->'canceled_at', ap.* | |
from artko.ms_processes_accountingpoint ap | |
, artko.ms_processes_subprocess s | |
where s.uid = ap.process_uid | |
and s.name in ('DISCONNECT_TKO') | |
and ( | |
(s.parent_uid is null and s.started_at > '2023-05-10T15:00:00+00:00'::timestamptz and s.finished_at > '2023-05-10T15:00:00+00:00'::timestamptz) | |
or (s.parent_uid is not null and s.created_at > '2023-05-10T15:00:00+00:00'::timestamptz) |
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
python manage.py shell -c ' | |
from django_redis import get_redis_connection | |
from datahub_core.datetime_utils import datetime_utcnow | |
from ms_tko.models import AccountingPoint | |
client = get_redis_connection("default") | |
counter = 0 | |
chunk_size = 50000 |