Follow review comments

This commit is contained in:
keisuke-umezawa
2024-02-06 21:35:53 +09:00
parent 0dfe9a7cab
commit f0751b8d48
2 changed files with 47 additions and 72 deletions
+11
View File
@@ -1,9 +1,20 @@
from optuna_dashboard._storage import trials_cache
from optuna_dashboard._storage import trials_cache_lock
from optuna_dashboard._storage import trials_last_fetched_at
from playwright.sync_api import Page
def clear_inmemory_cache() -> None:
with trials_cache_lock:
trials_cache.clear()
trials_last_fetched_at.clear()
def count_components(page: Page, component_name: str):
component_count = page.evaluate(
f"""() => {{
const components = document.querySelectorAll('.{component_name}');
return components.length;
}}"""
)
return component_count