Исправить замечания ревью кода: убрать повтор в AppendOnce за счёт запаса у чистки ключей, вынести MessagePayload и SameContent, принять X-Request-Id от балансировщика, упростить фоновые задачи сервера, сократить комментарии
This commit is contained in:
@@ -24,13 +24,11 @@ type ChatRepository interface {
|
||||
}
|
||||
|
||||
type MessageRepository interface {
|
||||
// AppendOnce stores message under the sender's key in its chat, unless
|
||||
// the key was used there within ttl; it returns the message the key is
|
||||
// bound to: the given one or the earlier one.
|
||||
// AppendOnce stores message under the sender's key unless the key was
|
||||
// used in this chat within ttl, and returns the message the key is bound
|
||||
// to: the given one or the earlier one.
|
||||
AppendOnce(ctx context.Context, message Message, key string, ttl time.Duration) (Message, error)
|
||||
// DeleteExpiredKeys removes up to limit keys older than ttl and reports
|
||||
// how many it removed.
|
||||
DeleteExpiredKeys(ctx context.Context, ttl time.Duration, limit int) (int64, error)
|
||||
DeleteExpiredKeys(ctx context.Context, olderThan time.Duration, limit int) (int64, error)
|
||||
// ListByChat returns up to limit messages ordered by (created_at, id),
|
||||
// strictly after the message identified by after when set. An unknown
|
||||
// chat yields an empty history.
|
||||
|
||||
Reference in New Issue
Block a user