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

Suggested feature, caching vpn calls #1

Open
jaclu opened this issue Jan 4, 2022 · 2 comments
Open

Suggested feature, caching vpn calls #1

jaclu opened this issue Jan 4, 2022 · 2 comments

Comments

@jaclu
Copy link

jaclu commented Jan 4, 2022

Hi, I am using the Mullvad VPN and tmux, so I took this plugin as kind of an inspiration to do a mullvad dito.

One thing I noticed early on was that for each plugin feature displayed on each update it made its own call resulting in the underlying VPN tool to be called. Since such calls tend to be somewhat slow, they all showed up in htop, so I made a fairly simplistic caching mechanism, that only actually calls the API once every 5 seconds.
I have never tried Nord VPN, but I guess it would be similar in this regard. Anyhow feel free to grab my caching, or even better implement an improvement :) You can find my humble take at jaclu/tmux-mullvad in the script scripts/helpers.sh

@maxrodrigo
Copy link
Owner

Hi @jaclu,
Sorry for the late reply. I'll definitely check that out.
Thanks!!

@jaclu
Copy link
Author

jaclu commented Jul 5, 2022

That was ages ago and the location has changed a bit you find my caching in this file https://github.com/jaclu/tmux-mullvad/blob/main/scripts/utils.sh
The function caching_mullvad_status is where the caching updates happen

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