Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- redIs = redis.Redis()
- pipe = redIs.pipeline()
- n = 1
- for line in open(path_to_file, 'r', encoding='utf-8'):
- pipe.sadd('todo', line.rstrip())
- n = n + 1
- if (n % 64) == 0:
- pipe.execute()
- pipe = redIs.pipeline()
- def restart_redis_instance(name="redis_test"):
- share_path = ('/E/test')
- volumes = {share_path: {'bind': '/data', 'mode': ''}}
- client = docker.from_env()
- try:
- kont = client.containers.get(name)
- kont.remove(force=True)
- except:
- pass
- client.containers.run(name=name,
- image="redis",
- ports={6379: 6379},
- detach=True,
- mem_limit='8g',
- volumes=volumes)
Add Comment
Please, Sign In to add comment