Closed sosedoff closed 6 years ago
Can I take this?
Go for it!
I am sorry, but I am not able to figure out how I should fix this. Any help?
If you still want to implement this feature, here's a few things to do:
--idle-timeout
(int) to specify maximum connection idle time in minutes, default to 3 hours (180 mins)--disable-connection-idle-timeout
(bool) to disable the timeout feature altogetherIs fixing client.IsIdle() func up to using with 2 new clli flags enough? Or i missunderstood session cleanup worker?
Yeah, 2 new flags should control how the cleanup worker terminates idle connection. If we have --disable-connection-idle-timeout
set to false we should just turn off the worker here https://github.com/sosedoff/pgweb/blob/master/pkg/cli/cli.go#L201
https://github.com/ldinc/pgweb/commit/3067b06bf6e8b7f0efd6849983bd4205ddb48915 Or better change timeout minutes from float64 to int?
This has been implemented via the following flags:
--no-idle-timeout Disable connection idle timeout (false)
--idle-timeout= Set connection idle timeout in minutes (180)
Currently we have the inactive timeout value hardcoded in the code, see: https://github.com/sosedoff/pgweb/blob/b6167ce422ee26113222503df60932adc2736ba2/pkg/client/client.go#L369 This should be configurable using 2 new cli options:
--disable-connection-idle-timeout
- Turn off the feature--idle-timeout
- Set the timeout value