GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — codis/example/sentinel.py at release3.2 · coder-java-caicai/codis Expand file tree/ Copy pathsentinel.pyMore file actions 42 lines (29 loc) · 1015 Bytes / Copy pathsentinel.pyFile metadata and controls42 lines (29 loc) · 1015 Bytes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 #!/usr/bin/env python3 from utils import * import atexit import json import datetime class CodisSentinel(Process): def __init__(self, port): self.config = self._open_config(port) self.port = port self.logfile = "sentinel-{}.log".format(port) self.command = "codis-server {} --sentinel".format(self.config) Process.__init__(self, self.command, self.logfile) dict = {"port": port, "pid": self.proc.pid} print(" >> codis.sentinel = " + json.dumps(dict, sort_keys=True)) @staticmethod def _open_config(port): config = 'sentinel-{}.conf'.format(port) with open(config, "w+") as f: f.write('port {}'.format(port)) return config if __name__ == "__main__": children = [] atexit.register(kill_all, children) for port in range(26380, 26385): children.append(CodisSentinel(port)) check_alive(children, 3) while True: print(datetime.datetime.now()) time.sleep(5) |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |