civo / cli

Our Command Line Interface (CLI) for interacting with your Civo resources
Apache License 2.0
178 stars 88 forks source link

Add config option to disable github version checks #313

Open cpretzer opened 1 year ago

cpretzer commented 1 year ago

Using the civo CLI (especially while testing script) causes a lot of version checks to the GitHub API when the VersionCheck method is called from various places.

I'd like a configuration option to disable the version check.

I've forked the repo and want to start working on this, and would appreciate guidance on how the config file is modified and consumed.

So far, I've got a working version that adds a condition to the statement to determine whether the version check should be called.

alejandrojnm commented 1 year ago

The last version of the CLI only checks that every 24h

cpretzer commented 1 year ago

I saw that line of code, but that doesn't seem to be the case for me. Perhaps I'm doing something unexpected by calling the civo CLI from within a bash script?

What I'm seeing is that GH is throttling my calls after a few runs of my script.

Upon looking closer at the code, I think I might be looking in the wrong place. The CivoAPIClient function calls common.VersionCheck() without any condition on whether it should be making that call to the GitHub API. Do you think this might be the cause?