Skip to content

Instantly share code, notes, and snippets.

View artemholovnia's full-sized avatar

Artem Holovnia artemholovnia

  • Poland, Lublin
View GitHub Profile
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)
@artemholovnia
artemholovnia / 8710.py
Last active October 11, 2023 17:37
8710
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