6c143096249ee891c37637d42e661c2a3f58252b
Improve the reliability of conversation sequence generation by implementing a fallback mechanism to the database when Redis is unavailable or when keys are missing. - Add `GetNextSeq` to `MessageRepository` and implement it in `MessageRepositoryAdapter`. - Update `ConversationCache` to fallback to DB in `GetConvMaxSeq`, `GetConvMaxSeqBatch`, and `GetNextSeq`. - Ensure Redis TTL is refreshed after every `INCR` operation to prevent sequence counter expiration. - Refactor service layers to handle sequence generation errors more explicitly. - Add `IsEnabled` helper to `LayeredCache` for cleaner availability checks.
Description
No description provided
Languages
Go
99.8%