flashmob / go-guerrilla

Mini SMTP server written in golang
MIT License
2.79k stars 366 forks source link

add able to configure DB connection limits in sql backend #176

Closed lord-alfred closed 5 years ago

lord-alfred commented 5 years ago

PR for https://github.com/flashmob/go-guerrilla/issues/174

I think you can make a description on the wiki:

sql_max_open_conns - sets the maximum number of open connections to the database. The default is 0 (unlimited).

sql_max_idle_conns - sets the maximum number of connections in the idle connection pool. The default is 2.

sql_max_conn_lifetime - sets the maximum amount of time a connection may be reused.

The sum of sql_max_open_conns and sql_max_idle_conns should not be greater than max_connections for MySQL or PostgreSQL. sql_max_idle_conns must be less than sql_max_open_conns.

sql_max_conn_lifetime must be less than wait_timeout in MySQL.

lord-alfred commented 5 years ago

@flashmob why Travis build failed? (I newbie in golang and dont understand where I broke syntax)

flashmob commented 5 years ago

It looks like you didn't run "go fmt" before committing.

https://blog.golang.org/go-fmt-your-code

😀

On Fri., 16 Aug. 2019, 23:30 Lord Alfred, notifications@github.com wrote:

@flashmob https://github.com/flashmob why Travis build failed? (I newbie in golang and dont understand where I broke syntax)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/flashmob/go-guerrilla/pull/176?email_source=notifications&email_token=AAE6MP2QE7GVSP6NAYVPGPDQE22YNA5CNFSM4IMB25A2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4OYUVQ#issuecomment-522029654, or mute the thread https://github.com/notifications/unsubscribe-auth/AAE6MP4SLTNMEPXE2VHYPD3QE22YNANCNFSM4IMB25AQ .

lord-alfred commented 5 years ago

Sorry, I didn’t know about it 😬

lord-alfred commented 5 years ago

Improved what you wrote in the review and corrected the first post with info for wiki 👍