Skip to content

Commit

Permalink
Don't wait for all requests before uploading
Browse files Browse the repository at this point in the history
  • Loading branch information
OFFTKP committed Aug 17, 2024
1 parent f7ce0f5 commit 9952cc2
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/atlas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ void atlas_t::add_tile(const std::string& url, atlas_tile_t* tile, cached_image_
atlas_tile_t* old_tile = map->total_tiles[image_url];
cached_image_t* old_cached_image = image_cache[image_url];
copy_to_data(old_tile, old_cached_image);
old_tile->atlas_id = SG_INVALID_ID; // old tile is no longer valid
}
}

Expand Down Expand Up @@ -434,10 +435,6 @@ atlas_tile_t* atlas_add_tile_from_path(atlas_map_t* map, const char* path) {
void atlas_upload_all() {
std::unique_lock<std::mutex> lock(atlas_maps_mutex);
for (atlas_map_t* map : atlas_maps) {
if (map->requests > 0) {
continue; // probably a lot of outstanding requests and we don't wanna update too often
}

map->upload_all();
}
lock.unlock();
Expand Down

0 comments on commit 9952cc2

Please sign in to comment.