Commit c05a51e6 authored by BO ZHANG's avatar BO ZHANG 🏀
Browse files

update DFS

parent 905613a9
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -34,9 +34,10 @@ def check_port(ip, port, timeout=3):
class DFS:
    def __init__(self, location=None):
        # try each location
        print("Test all locations:")
        print("Test all locations:", end="")
        status_list = []
        for loc in CONFIG.keys():
            print(f"{loc}...", end="")
            dfs_ip = CONFIG[loc]["dfs"]["CSST_DFS_GATEWAY"].split(":")[0]
            dfs_port = int(CONFIG[loc]["dfs"]["CSST_DFS_GATEWAY"].split(":")[1])
            redis_ip = CONFIG[loc]["redis"]["host"]
@@ -50,7 +51,8 @@ class DFS:
                redis=this_redis_status,
            )
            status_list.append(this_status)
            print(this_status)
            # print(this_status)
        print("Done!\n")
        status_table = Table(status_list)
        print(status_table)

@@ -83,10 +85,9 @@ class Redis(redis.Redis):
        )
        self.qname = password = CONFIG[location]["redis"]["qname"]
        self.config = CONFIG[location]["redis"]

        print("Setting redis config:")
        for k, v in self.config.items():
            print(f" - {k}: {v}")
        # print("Setting redis config:")
        # for k, v in self.config.items():
        #     print(f" - {k}: {v}")

    def push(self, msg):
        self.lpush(self.qname, msg)