mirror of
https://github.com/bdnugget/freeminer.git
synced 2026-11-07 06:57:27 +00:00
cdn
This commit is contained in:
1 parent
24fe82ef55
commit
e1f4edd3a6
3 files changed
+7
-9
No files matched your search
@@ -88,8 +88,8 @@ size_t multi_http_to_file(
|
||||
return std::filesystem::file_size(path);
|
||||
};
|
||||
|
||||
size_t multi_http_to_file_cdn(
|
||||
const std::string &name, std::vector<std::string> links, const std::string &path)
|
||||
size_t multi_http_to_file_cdn(const std::string &dir, const std::string &name,
|
||||
std::vector<std::string> links, const std::string &path)
|
||||
{
|
||||
links.insert(links.begin(),
|
||||
#if defined(__EMSCRIPTEN__)
|
||||
@@ -97,8 +97,7 @@ size_t multi_http_to_file_cdn(
|
||||
#else
|
||||
"http://cdn.freeminer.org/"
|
||||
#endif
|
||||
"earth/" +
|
||||
name);
|
||||
+ dir + "/" + name);
|
||||
return multi_http_to_file(name, links, path);
|
||||
}
|
||||
|
||||
@@ -134,7 +133,6 @@ size_t multi_http_to_file(const std::vector<std::string> &links, const std::stri
|
||||
return std::filesystem::file_size(path);
|
||||
};
|
||||
|
||||
|
||||
std::string exec_to_string(const std::string &cmd)
|
||||
{
|
||||
std::unique_ptr<FILE, decltype(&pclose)> pipe(popen(cmd.c_str(), "r"), pclose);
|
||||
|
||||
@@ -8,7 +8,7 @@ size_t multi_http_to_file(const std::string &zipfile,
|
||||
const std::vector<std::string> &links, std::string zipfull = {});
|
||||
size_t multi_http_to_file(
|
||||
const std::vector<std::string> &links, const std::string &zipfull);
|
||||
size_t multi_http_to_file_cdn(const std::string &name, std::vector<std::string> links,
|
||||
const std::string &path = {});
|
||||
size_t multi_http_to_file_cdn(const std::string &dir, const std::string &name,
|
||||
std::vector<std::string> links, const std::string &path = {});
|
||||
|
||||
std::string exec_to_string(const std::string &cmd);
|
||||
@@ -221,7 +221,7 @@ MapgenEarth::MapgenEarth(MapgenEarthParams *params_, EmergeParams *emerge) :
|
||||
if (!std::filesystem::exists(heat_img)) {
|
||||
const auto lock = std::lock_guard(maps_holder->download_lock);
|
||||
if (!std::filesystem::exists(heat_img)) {
|
||||
multi_http_to_file_cdn("earth_heat.png", {});
|
||||
multi_http_to_file_cdn("earth", "earth_heat.png", {});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -429,7 +429,7 @@ void MapgenEarth::generateBuildings()
|
||||
const auto lock = std::lock_guard(maps_holder->osm_http_lock);
|
||||
if (!std::filesystem::exists(base_full_name)) {
|
||||
const auto url = "https://osm.download.movisda.io/grid/" + filename;
|
||||
multi_http_to_file({url}, base_full_name);
|
||||
multi_http_to_file_cdn("movisda_grid", filename, {url});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user