mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 00:00:04 +00:00 
			
		
		
		
	Optimization of object listing by date
This commit is contained in:
		
							parent
							
								
									f452d3f15d
								
							
						
					
					
						commit
						da835d7226
					
				
					 4 changed files with 29 additions and 12 deletions
				
			
		|  | @ -683,9 +683,15 @@ RadarProductManager::GetActiveVolumeTimes( | |||
| { | ||||
|    std::unordered_set<std::shared_ptr<provider::NexradDataProvider>> | ||||
|                                                    providers {}; | ||||
|    std::set<std::chrono::system_clock::time_point> volumeTimes; | ||||
|    std::set<std::chrono::system_clock::time_point> volumeTimes {}; | ||||
|    std::mutex                                      volumeTimesMutex {}; | ||||
| 
 | ||||
|    // Return a default set of volume times if the default time point is given
 | ||||
|    if (time == std::chrono::system_clock::time_point {}) | ||||
|    { | ||||
|       return volumeTimes; | ||||
|    } | ||||
| 
 | ||||
|    // Lock the refresh map
 | ||||
|    std::shared_lock refreshLock {p->refreshMapMutex_}; | ||||
| 
 | ||||
|  | @ -717,6 +723,12 @@ RadarProductManager::GetActiveVolumeTimes( | |||
|                        dates.end(), | ||||
|                        [&](const auto& date) | ||||
|                        { | ||||
|                           // Don't query for a time point in the future
 | ||||
|                           if (date > std::chrono::system_clock::now()) | ||||
|                           { | ||||
|                              return; | ||||
|                           } | ||||
| 
 | ||||
|                           // Query the provider for volume time points
 | ||||
|                           auto timePoints = provider->GetTimePointsByDate(date); | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat