Skip to content

828 optimize data retrieval and clean it up#829

Open
bogadisa wants to merge 6 commits into
mainfrom
828-optimize-data-retrieval-and-clean-it-up
Open

828 optimize data retrieval and clean it up#829
bogadisa wants to merge 6 commits into
mainfrom
828-optimize-data-retrieval-and-clean-it-up

Conversation

@bogadisa

Copy link
Copy Markdown
Collaborator

No description provided.

@bogadisa
bogadisa requested a review from Ivareh July 18, 2026 19:00
@bogadisa bogadisa linked an issue Jul 18, 2026 that may be closed by this pull request
@bogadisa bogadisa added the backend.Cache Includes redis label Jul 18, 2026
@bogadisa
bogadisa force-pushed the 828-optimize-data-retrieval-and-clean-it-up branch from 624224c to 4215ff5 Compare July 18, 2026 19:11
crashed: bool = False,
listener_id: int = None,
) -> dict[Future, Literal["listener_0", "listener_1"]]:
if settings.MANUAL_NEXT_CHANGE_ID:

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make it depend on league

logger.info("Initializing follow stream threads")
self.rate_limiter = RateLimiterThreadSafe()
self.mini_batch_size = settings.MINI_BATCH_SIZE
self.pending_queue = Queue(maxsize=self.mini_batch_size)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename

max_connections=2,
max_keepalive_connections=2,
),
timeout=httpx.Timeout(10, read=60),

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove?

)
logging.getLogger("httpx").setLevel(logging.WARNING)
futures = {}
if (listener_id is None and not crashed) or listener_id == 0:

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

refactor

while i < self.mini_batch_size:
try:
pending: PendingResponse | None = self.pending_queue.get(timeout=30)
except Empty:

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove?

@bogadisa bogadisa left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Optimize data retrieval and clean it up

1 participant