James McCool commited on
Commit
256492d
·
1 Parent(s): 6e9c2dc

Update caching mechanism in Streamlit app for resource initialization

Browse files

- Adjusted the caching decorator for the init_baselines function to include a TTL of 61 seconds, optimizing resource management and performance.
- This change aims to enhance the efficiency of data retrieval and ensure that the app reflects the most current data without excessive caching delays.

Files changed (1) hide show
  1. src/streamlit_app.py +1 -1
src/streamlit_app.py CHANGED
@@ -52,7 +52,7 @@ st.markdown("""
52
  }
53
  </style>""", unsafe_allow_html=True)
54
 
55
- @st.cache_resource()
56
  def init_baselines():
57
 
58
  db_pulls = ['Bullpen_Data', 'Hitter_Agg_Merge', 'Hitter_Long_Merge', 'Hitter_Short_Merge', 'Pitcher_Agg_Merge', 'Pitcher_Long_Merge', 'Pitcher_Short_Merge',
 
52
  }
53
  </style>""", unsafe_allow_html=True)
54
 
55
+ @st.cache_resource(ttl = 61)
56
  def init_baselines():
57
 
58
  db_pulls = ['Bullpen_Data', 'Hitter_Agg_Merge', 'Hitter_Long_Merge', 'Hitter_Short_Merge', 'Pitcher_Agg_Merge', 'Pitcher_Long_Merge', 'Pitcher_Short_Merge',