Skip to content
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

Cache does not seem to be getting used in my macOS environment #824

Open
sideshowbarker opened this issue Jan 21, 2025 · 5 comments
Open

Comments

@sideshowbarker
Copy link

sideshowbarker commented Jan 21, 2025

I have gcalcli installed and working as expected — except that the cache does not seem to be getting used. nothing seems to be getting cached.

Steps to reproduce

Install gcalcli per the instructions in the repo. Run a few gcalcli commands. Notice that the responses always come back relatively slowly (~4–6 seconds in my environment) — indicating that the responses are not getting served from the cache but instead gcalcli is sending new requests over the network each time.

Check the ~/Library/Application Support/gcalcli/ directory and notice there’s no cache there.

Expected behavior

A cache should be found in the ~/Library/Application Support/gcalcli/ directory, and responses should be getting served from the cache rather than gcalcli sending new requests over the network each time.

Actual behavior

There is a cache in the ~/Library/Application Support/gcalcli/ directory, but responses do not seem to be getting served from the cache; instead, gcalcli seems to be sending new requests over the network each time. And the cache does not seem to ever be getting updated.

Fixing

I’m still investigating and trying to isolate how this could be fixed in the code, and I’d be willing to contribute a patch myself for fixing it — if/when I do manage to figure it out on my own.

But if somebody else manages to find and fix it first, that’d be great too 😀

@dbarnett
Copy link
Collaborator

@sideshowbarker oh, did you figure out the problem?

@sideshowbarker
Copy link
Author

Hi @dbarnett — I didn’t actually get it figured out. I initially closed it because — despite what I said the issue description — I found that I did in fact have a ~/Library/Application Support/gcalcli/cache file.

However, I subsequently found that that case file never seems to get updated.

Every time I run gcalcli agenda, it takes 4–6 seconds to respond. And when I check my network while it’s running, I see that it’s hitting the network every single time.

I’ve not yet been able to do any useful troubleshooting to try to isolate what might be going wrong. But I’ll go ahead and reopen this in the meantime.

@dbarnett
Copy link
Collaborator

Which version are you running?

Try gcalcli util reset-cache if you have a new enough version to support it. Probably won't fix anything but maybe it would at least get a clear error message if something is broken with the cache file.

@sideshowbarker
Copy link
Author

Running gcalcli util reset-cache deletes the cache as expected — without emitting any errors or anything else than just Deleting cache file from /Users/mike/Library/Application Support/gcalcli/cache....

After running gcalcli agenda, I see the cache file gets recreated — but then every subsequent gcalcli agenda invocation takes roughly the same amount of time (4–6 seconds) as the first one after resetting the cache did.

@sideshowbarker sideshowbarker changed the title Nothing getting cached in my macOS environment Cached not being does not seem to be getting used in my macOS environment Jan 28, 2025
@sideshowbarker sideshowbarker changed the title Cached not being does not seem to be getting used in my macOS environment Cache does not seem to be getting used in my macOS environment Jan 28, 2025
@sideshowbarker
Copy link
Author

Which version are you running?

The latest, I think:

$ gcalcli --version
gcalcli 4.5.1

…installed from brew:

$ which gcalcli
/opt/homebrew/bin/gcalcli

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants