添加缓存预热
This commit is contained in:
@@ -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()
|
||||
Reference in New Issue
Block a user