reinit_cache(
field: str = "All",
maxsize: int = 2 * 1024,
ttl: int = 60 * 60 * 24,
) -> None
Reinitialize some or all of the cache pools.
Parameters: |
-
field
(str , default:
'All'
)
–
It can be one of the following: 'All', 'Score', 'Publication', 'Trait', 'Trait_category', 'Performance', 'Cohort', 'Sample_set', 'Release', 'Ancestry_category'
-
maxsize
(int , default:
2 * 1024
)
–
The number of HTTP requests that can be stored in the cache pool.
-
ttl
(int , default:
60 * 60 * 24
)
–
The unit is seconds. Expiration time.
|
from pandaspgs import get_publications, reinit_cache
# Reinitialize all the cache pools. Each cache pool can only store 10 HTTP requests, and the expiration time is 10 seconds.
reinit_cache(field = 'All', maxsize = 10, ttl = 10)
pub = get_publications()
# Reinitialize the cache used by get_publications()
reinit_cache(field = 'Publication', maxsize = 10, ttl = 10)
pub = get_publications()