Skip to content

Commit

Permalink
use caching for portal resource display
Browse files Browse the repository at this point in the history
  • Loading branch information
kthare10 committed Jun 5, 2024
1 parent 5a6318a commit 50c30a8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions fabric_cf/orchestrator/core/orchestrator_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ def discover_broker_query_model(self, *, controller: ABCMgmtControllerMixin, tok
"""
broker_query_model = None
# Always get Fresh copy for advanced resource requests
if not start and not end and not includes and not excludes and level <= 1:
if not start and not end and not includes and not excludes and \
(level <= 1 or graph_format == GraphFormat.JSON_NODELINK):
saved_bqm = self.controller_state.get_saved_bqm(graph_format=graph_format, level=level)
if saved_bqm is not None:
if not force_refresh and not saved_bqm.can_refresh() and not saved_bqm.refresh_in_progress:
Expand Down Expand Up @@ -168,7 +169,8 @@ def discover_broker_query_model(self, *, controller: ABCMgmtControllerMixin, tok
broker_query_model = model.get_model()

# Do not update cache for advance requests
if not start and not end and not includes and not excludes and level <= 1:
if not start and not end and not includes and not excludes and \
(level <= 1 or graph_format == GraphFormat.JSON_NODELINK):
self.controller_state.save_bqm(bqm=broker_query_model, graph_format=graph_format, level=level)

return broker_query_model
Expand Down

0 comments on commit 50c30a8

Please sign in to comment.