You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i'm using your great workerpool, and i have a problem. I use the submit() function to add jobs that are processed by the workers. But these workers need to perform database tasks. When i submit my worker function and put the db.Open and db.Close inside, i have too many connections.
My Question is now : is it possible to let the workers themselves open and close the connections, so that i always have the limited number of connections open. That would be awesome
Thanks in advance
Adrian
The text was updated successfully, but these errors were encountered:
Are you using the standard library's database/sql package? If so, you can just create one sql.DB and share it. It has its own pool of connections. The limit is set by https://pkg.go.dev/database/sql#DB.SetMaxOpenConns , which by default is unlimited. If it tries to make that many connections, something else is wrong. Posting your code would help.
Hi Gammazero,
i'm using your great workerpool, and i have a problem. I use the submit() function to add jobs that are processed by the workers. But these workers need to perform database tasks. When i submit my worker function and put the db.Open and db.Close inside, i have too many connections.
My Question is now : is it possible to let the workers themselves open and close the connections, so that i always have the limited number of connections open. That would be awesome
Thanks in advance
Adrian
The text was updated successfully, but these errors were encountered: