添加缓存预热

This commit is contained in:
2026-05-26 01:50:30 +08:00
parent dad0af30de
commit e24cb69bec
2 changed files with 17 additions and 21 deletions
+15
View File
@@ -0,0 +1,15 @@
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()