From 6c9f903f3a3debeb2633bfad2a1051bfcd5556eb Mon Sep 17 00:00:00 2001 From: ulises-jeremias Date: Sat, 21 Oct 2023 13:36:10 -0300 Subject: [PATCH] Updated dataset download --- datasets/loader.v | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/datasets/loader.v b/datasets/loader.v index e8c22dc3..a0921bfc 100644 --- a/datasets/loader.v +++ b/datasets/loader.v @@ -19,7 +19,7 @@ struct RawDownload { target string } -fn load_from_url(data RawDownload) !string { +fn load_from_url(data RawDownload) ! { datasets_cache_dir := get_cache_dir('datasets') if !os.is_dir(datasets_cache_dir) { @@ -33,15 +33,10 @@ fn load_from_url(data RawDownload) !string { } if os.is_file(cache_file_path) { - return os.read_file(cache_file_path) + return } - res := http.get(data.url)! - content := res.body - - os.write_file(cache_file_path, content)! - - return content + http.download_file(data.url, cache_file_path)! } [params]