16 lines
358 B
Python
16 lines
358 B
Python
import time
|
|
|
|
from api.core.RedisPreheat import preheat_redis_cache
|
|
|
|
|
|
def main():
|
|
start = time.perf_counter()
|
|
print('Redis 缓存预热开始...')
|
|
warmed_keys = preheat_redis_cache()
|
|
duration = time.perf_counter() - start
|
|
print(f'Redis 缓存预热完成: {len(warmed_keys)} keys, {duration:.2f}s')
|
|
|
|
|
|
if __name__ == '__main__':
|
|
main()
|