feat(publishing): implement immediate raw ingestion, per-target Redis queues, and configurable post intervals & sleep windows

This commit is contained in:
mamad
2026-08-27 22:21:29 +03:30
parent e66ed361c3
commit 7e5e679917
8 changed files with 288 additions and 116 deletions
+2 -6
View File
@@ -143,9 +143,7 @@ class CollectorService:
SOURCE_ACTIVITY_TOTAL.labels(channel_id=str(chat_id), title=source.title or 'Unknown').inc()
logger.info(f"Collected raw post ID {post_id} from source channel {chat_id}")
if self.queue:
await self.queue.push(post_id)
elif self.on_post_received:
if self.on_post_received:
await self.on_post_received(post_id)
except Exception as e:
logger.error(f"Error handling message from {event.chat_id}: {e}", exc_info=True)
@@ -216,9 +214,7 @@ class CollectorService:
SOURCE_ACTIVITY_TOTAL.labels(channel_id=str(channel_id), title=source_title).inc()
logger.info(f"Backfilled raw post ID {post_id} from {channel_id}")
if self.queue:
await self.queue.push(post_id)
elif self.on_post_received:
if self.on_post_received:
await self.on_post_received(post_id)
else:
skipped_count += 1