Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Pass redis connection pool settings to config #1140

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Tetrergeru
Copy link
Member

Pass configuration for connection pool in go-redis to moira database configs

@Tetrergeru Tetrergeru marked this pull request as ready for review February 11, 2025 10:51
@Tetrergeru Tetrergeru requested a review from a team as a code owner February 11, 2025 10:51
@Tetrergeru
Copy link
Member Author

/build

Copy link

Build and push Docker images with tag: feat-pass-redis-connection-pool-to-config.2025-02-11.2a7e4a6

// Time to await for a client from client pool. Default value is 4s.
PoolTimeout string `yaml:"pool_timeout"`
// Size of client pool. Default value is 5 * GOMAXPROCS.
PoolSize int `yaml:"pool_size"`
Copy link
Member

Choose a reason for hiding this comment

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

А я правильно понимаю, что такие дефолтные значения задаёт либа? Мб тогда явно их пропишем, а то вдруг что-то в либе поменяется?

Copy link
Member

Choose a reason for hiding this comment

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

Либо из godoc уберём)

Copy link
Member Author

Choose a reason for hiding this comment

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

Возможно это хорошая идея, но надо подумать, как лучше сделать. Альтернативный вариант — обновлять документацию вместе с одновлением либы, потому что если в либе поменяют дефолтные значения — значит, скорее всего, в этом есть какой-то смысл

Copy link
Member Author

Choose a reason for hiding this comment

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

Ещё возможно стоит прокинуть в конфиг дополнительный параметр, чтобы можно было через конфиг задавать не просто фиксированное значение, а что-то типа PoolPerProc * GOMAXPROCS + PollSizeConst

Copy link
Member

Choose a reason for hiding this comment

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

Ещё возможно стоит прокинуть в конфиг дополнительный параметр, чтобы можно было через конфиг задавать не просто фиксированное значение, а что-то типа PoolPerProc * GOMAXPROCS + PollSizeConst

Вот это звучит прикольно

Альтернативный вариант — обновлять документацию вместе с одновлением либы, потому что если в либе поменяют дефолтные значения — значит, скорее всего, в этом есть какой-то смысл

Можно и так, но вариант с проставленными нами дефолтными значениями мне немного больше импонирует

Copy link
Member Author

Choose a reason for hiding this comment

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

Тогда, кстати, надо бы всем параметрам дефолтные значения выставить, вроде у базы все неявно ожидаются от библиотеки

Copy link
Member

Choose a reason for hiding this comment

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

блинб, и их же много да?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants