maxrodrigo/tmux-nordvpn

Suggested feature, caching vpn calls

jaclu opened this issue · 2 comments

jaclu commented

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

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

jaclu commented

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