Skip to content

chore(redis): update MANDATORY USAGE PATTERN docstring to reference get_async_redis_client #4058

Closed

Description

@mrveiss

Problem

The module-level MANDATORY USAGE PATTERN docblock in autobot_shared/redis_client.py still documents the async pattern as:

async_redis = await get_redis_client(async_client=True, database="main")

PR #4051 added get_async_redis_client() specifically because this pattern is error-prone (sync function returning an unawaited coroutine). The PR's own docstring labels the old pattern "error-prone", but the module-level MANDATORY USAGE PATTERN block was not updated — leaving the documented canonical pattern pointing to the approach the PR explicitly deprecated.

Additionally, the RedisDatabaseManager docstring's "NEW" migration example still shows get_redis_client(async_client=True) as the migration target.

Fix

Update the MANDATORY USAGE PATTERN block to show get_async_redis_client() as the async usage pattern. Update the RedisDatabaseManager "NEW" example similarly.

Discovered

During code review of PR #4051.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions