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(
197
197
Ok ( ( ) )
198
198
}
199
199
// 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
+
201
207
let user_id = user_id. ok_or ( CacheError :: Other ( "User Id not provided" ) ) ?;
202
208
203
209
if let Err ( err) = query_cache_manager
@@ -241,7 +247,12 @@ pub async fn get_results_from_cache(
241
247
) ;
242
248
None
243
249
}
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
+
245
256
let user_id =
246
257
user_id. ok_or_else ( || QueryError :: Anyhow ( anyhow ! ( "User Id not provided" ) ) ) ?;
247
258
You can’t perform that action at this time.
0 commit comments