本文整理匯總了Python中redis.client.StrictRedis.bgrewriteaof方法的典型用法代碼示例。如果您正苦於以下問題:Python StrictRedis.bgrewriteaof方法的具體用法?Python StrictRedis.bgrewriteaof怎麽用?Python StrictRedis.bgrewriteaof使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類redis.client.StrictRedis
的用法示例。
在下文中一共展示了StrictRedis.bgrewriteaof方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: rewrite_redis_aof_job
# 需要導入模塊: from redis.client import StrictRedis [as 別名]
# 或者: from redis.client.StrictRedis import bgrewriteaof [as 別名]
def rewrite_redis_aof_job():
current_veil_env = get_current_veil_env()
if not hasattr(current_veil_env.config, 'redis_servers'):
return
for host, port in current_veil_env.config.redis_servers:
client = StrictRedis(host=host, port=port)
if client.config_get('appendonly')['appendonly'] != 'yes':
continue
client.bgrewriteaof()