gh-cli-for-education / gh-edu

A pluggable extension of gh-cli to assist educators and students using GitHub Education
https://github.com/gh-cli-for-education/TFG-2122-Cristo-Garcia-Gonzalez
3 stars 0 forks source link

For a medium size org the caching takes time "gh edu set -o" #6

Open crguezl opened 2 years ago

crguezl commented 2 years ago

Took 4 or 5 minutes to finish:

➜  gh-edu git:(main) gh edu set -o ULL-ESIT-PL-2122
Not in cache. Fetching... (Cache will be updated)
Default org set to:  ULL-ESIT-PL-2122

May be we can warn the user to wait or give some estimation of the time is going to take?

crguezl commented 2 years ago

Another bump just now on this. Tried to change the org (Here cd is an alias of gh edu ...) and took minutes to tell me that I misspelled the org name:

➜  gh-edu git:(main) ✗ gh cd ULL-ESIT-DMSI-2122             
Not in cache. Fetching... (Cache will be updated)
That organization couldn't be found:
ULL-ESIT-DMSI-2122

I know in the long run it is not often that cache has to be updated but is something we have to think.

To cache or not to cache?, that is the question. Whether ’tis nobler in the mind to suffer long delays a few times or ...

GGCristo commented 2 years ago

This is going to be hard for me to test, but one straightforward solution is to only cache the organization itself, not all of them.

crguezl commented 2 years ago

In the example before, I don't know why it took so long if the organization didn't exists

GGCristo commented 2 years ago

@crguezl Now set -o will cache only the corresponding organization.