File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -197,7 +197,13 @@ pub async fn put_results_in_cache(
197197 Ok ( ( ) )
198198 }
199199 // do cache
200- ( Some ( _) , Some ( query_cache_manager) ) => {
200+ ( Some ( should_cache) , Some ( query_cache_manager) ) => {
201+
202+ if should_cache != "true" {
203+ log:: error!( "value of cache results header is false" ) ;
204+ return Err ( QueryError :: CacheError ( CacheError :: Other ( "should not cache results" ) ) ) ;
205+ }
206+
201207 let user_id = user_id. ok_or ( CacheError :: Other ( "User Id not provided" ) ) ?;
202208
203209 if let Err ( err) = query_cache_manager
@@ -241,7 +247,12 @@ pub async fn get_results_from_cache(
241247 ) ;
242248 None
243249 }
244- ( Some ( _) , Some ( query_cache_manager) ) => {
250+ ( Some ( should_show) , Some ( query_cache_manager) ) => {
251+ if should_show != "true" {
252+ log:: error!( "value of show cached header is false" ) ;
253+ return Err ( QueryError :: CacheError ( CacheError :: Other ( "should not return cached results" ) ) ) ;
254+ }
255+
245256 let user_id =
246257 user_id. ok_or_else ( || QueryError :: Anyhow ( anyhow ! ( "User Id not provided" ) ) ) ?;
247258
You can’t perform that action at this time.
0 commit comments