2
0
mirror of https://github.com/hibiken/asynq.git synced 2025-04-19 23:30:20 +08:00

warn user when they set a big number of janitor batch size

This commit is contained in:
Agung Hariadi Tedja 2023-08-08 09:54:42 +07:00
parent 0db497a8e0
commit b4676d1af5

View File

@ -554,6 +554,10 @@ func NewServer(r RedisConnOpt, cfg Config) *Server {
if janitorBatchSize == 0 {
janitorBatchSize = defaultJanitorBatchSize
}
if janitorBatchSize > defaultJanitorBatchSize {
logger.Warnf("Janitor batch size of %d is greater than the recommended batch size of %d. "+
"This might cause a long-running script", janitorBatchSize, defaultJanitorBatchSize)
}
janitor := newJanitor(janitorParams{
logger: logger,
broker: rdb,