Skip to content

Add check for file existance before fetching from the server

Adithya Venkateswaran requested to merge feature/prevent_api_overloading into master

What is it about?

Addresses #2 (closed)

Currently vv fetches all the files it needs without checking if those files already exist. This wastes bandwidth, time and puts unnecessary load on swpc-noaa servers. This MR tries to fix that.

How do I test?

Till the logging MR is merged (hopefully before this one), you can run the following script in the terminal and try to see a time difference.

Note that the files will be downloaded to the current working directory. So it is advisable to run the program in an empty directory.

# First run: runtime is 32.6 s
❯ time python sample_script.py
python sample_script.py  0.70s user 0.23s system 2% cpu 32.602 total

# Second run: runtime is 0.4 s
❯ time python sample_script.py
python sample_script.py  0.53s user 0.21s system 166% cpu 0.442 total

sample_script.py

Signed-off-by: Adithya Venkateswaran adithyav1511@gmail.com

Merge request reports