private void requestCacheUpdate ( ) { log . debug ( "Cache update requested" ) ; if ( updateRequested ) { log . debug ( "Cache update, redundant request ignored." ) ; return ; } updateRequested = true ; if ( ! updating ) { updateCache ( ) ; } }
Just run updateCache one time if multiple requests come in while an update is already in progress ...