ajvb / kala

Modern Job Scheduler
MIT License
2.13k stars 188 forks source link

when jobDBPassword=""or not input jobDBPassword para #153

Closed JasonShenShen closed 7 years ago

JasonShenShen commented 7 years ago

when i use following args run , it has some errors.. //my redis is not set passwd for connection ./kala run -p 40001 --jobDB=redis --jobDBAddress=192.168.6.151:6379 FATA[0000] ERR Client sent AUTH, but no password is set

./kala run -p 40001 --jobDB=redis --jobDBAddress=192.168.6.151:6379 --jobDBPassword="" panic: runtime error: invalid memory address or nil pointer dereference

1.Because of default jobDBPassword is 'password' 2.Because of DialOption in kala/job/storage/redis.go is nil and redigo/redis will get error in calling Dial func. //redigo/redis/conn.go for _, option := range options { option.f(&do) }

So, i add Newnopass func for no password args call redis.Dial("tcp", address), it tests OK. Please check if it needs merge, thx.

ajvb commented 7 years ago

Thanks for the PR @JasonShenShen!

  1. I think we should change the default password to be empty string instead of password.
  2. Instead of using Newnopass, I think we should do the if-else in the redis.New() on checking whether the DialOption is nil.
JasonShenShen commented 7 years ago

OK, I will update my code and pull another request, Thanks for your suggestions