mirror of
https://github.com/wassname/optuna-dashboard.git
synced 2026-09-11 12:30:25 +08:00
Add the force update for disabled live update
This commit is contained in:
@@ -192,7 +192,7 @@ def create_app(
|
||||
@json_api_view
|
||||
def get_study_detail(study_id: int) -> dict[str, Any]:
|
||||
# Use the following default values if not specified in request.params.
|
||||
query_params = dict(after=0, limit=1000)
|
||||
query_params = dict(after=0, limit=2000)
|
||||
for query_key in query_params:
|
||||
try:
|
||||
query_params[query_key] = int(request.params[query_key])
|
||||
@@ -235,6 +235,7 @@ def create_app(
|
||||
plotly_graph_objects = get_plotly_graph_objects(system_attrs)
|
||||
skipped_trial_ids = get_skipped_trial_ids(system_attrs)
|
||||
skipped_trial_numbers = [t.number for t in trials if t._trial_id in skipped_trial_ids]
|
||||
limit = len(trials) if limit == 0 else limit
|
||||
fetched_trials_partially = after + limit < len(trials)
|
||||
return serialize_study_detail(
|
||||
summary,
|
||||
|
||||
@@ -235,9 +235,9 @@ export const actionCreator = () => {
|
||||
})
|
||||
}
|
||||
|
||||
const updateStudyDetail = (studyId: number) => {
|
||||
const updateStudyDetail = (studyId: number, forceFetchAllTrials: boolean = false) => {
|
||||
let nLocalFixedTrials = 0
|
||||
const nMaximumTrialsAtOnce = 2000
|
||||
const nMaximumTrialsAtOnce = forceFetchAllTrials ? 0 : 2000
|
||||
if (studyId in studyDetails) {
|
||||
const currentTrials = studyDetails[studyId].trials
|
||||
const firstUpdatable = currentTrials.findIndex((trial) =>
|
||||
|
||||
@@ -310,7 +310,12 @@ export const AppDrawer: FC<{
|
||||
<ListItemButton
|
||||
sx={styleListItemButton}
|
||||
onClick={() => {
|
||||
action.saveReloadInterval(reloadInterval === -1 ? 10 : -1)
|
||||
const newReloadInterval = reloadInterval === -1 ? 10 : -1
|
||||
action.saveReloadInterval(newReloadInterval)
|
||||
if (newReloadInterval === -1) {
|
||||
const forceFetchAllTrials = true
|
||||
action.updateStudyDetail(studyId, forceFetchAllTrials)
|
||||
}
|
||||
}}
|
||||
>
|
||||
<ListItemIcon sx={styleListItemIcon}>
|
||||
|
||||
Reference in New Issue
Block a user