-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Client does not get cleaned up properly #72
Comments
Seems like enough of a reason to investigate for me. I'll leave this issue open and investigate as soon as I get some time. |
First suggestion that just jumped out at me would be to have your "User" object have a Anyhow, I am not saying that the issue you reported isn't an issue or rate.Limiter isn't a good fix, but maybe my suggestions will help overall? :) ~tommy |
I already did that - right after finding out that it is an issue. I was creating the client whenever I needed it because I thought it was disposable and I haven't encountered another package that was having issues with CPU usage whenever a new Client is created. I'm not using webhooks as the application is not running on a server with a public ip address, but I plan on changing that. Thanks for your hints though! |
Yea, I was going to suggest having a getTrelloClient() method that did some sort of checksum or something, good call. All too familiar with the internal server thing. :) |
Hi there,
I have built an application using this library - it works really well, so thanks for creating it! I have a background goroutine that tries to sync some data between Trello and another service every couple of minutes. In my loop, I create a new
trello.Client
viaNewClient
and noticed that over time, my CPU usage becomes really high. I think it might be related to the throttling built into the library, becausetime.Tick
does not get cleaned up properly (apparently you're supposed to usetime.NewTicker
and stop it,ref
).I'm not 100% sure that this is the exact cause, but if I do not create a trello client in my loop, the CPU usage stays the same over time.
I'm not sure if there is some sort of best practice on how to resolve this so I wanted to open an issue first - maybe there can be an option to disable the throttling or expose the ticker so that I can stop it myself when I know I won't need the
Client
anymore? Happy to help out with the solution.Cheers and thanks again for the library!
Example code (might not work, I removed some parts of my application)
The text was updated successfully, but these errors were encountered: