From 5bf5e1e1c23d24673e3fe009fbe7fd7ea39a8ded Mon Sep 17 00:00:00 2001 From: dekzter Date: Thu, 1 May 2025 17:30:19 -0400 Subject: [PATCH] updated last_seen of existing streams: --- apps/m3u/tasks.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/m3u/tasks.py b/apps/m3u/tasks.py index 20ed1acb..90992dbc 100644 --- a/apps/m3u/tasks.py +++ b/apps/m3u/tasks.py @@ -292,8 +292,8 @@ def process_m3u_batch(account_id, batch, groups, hash_keys): Stream.objects.bulk_create(streams_to_create, ignore_conflicts=True) if streams_to_update: Stream.objects.bulk_update(streams_to_update, { key for key in stream_props.keys() if key not in ["m3u_account", "stream_hash"] and key not in hash_keys}) - # if len(existing_streams.keys()) > 0: - # Stream.objects.bulk_update(existing_streams.values(), ["last_seen"]) + if len(existing_streams.keys()) > 0: + Stream.objects.bulk_update(existing_streams.values(), ["last_seen"]) except Exception as e: logger.error(f"Bulk create failed: {str(e)}")