Skip to content

Commit

Permalink
data serve wrapper done
Browse files Browse the repository at this point in the history
  • Loading branch information
dasbd72 committed Sep 24, 2023
1 parent 354f527 commit b122364
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions pkg/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,10 @@ def copy_to_local():

save_hash_to_file(calculate_hash(local_dst), self.get_hash_file_path(local_dst))

self.etcd_client.put(file_path, self.data_serve_ip_port)
self.etcd_client.put(local_dst, self.data_serve_ip_port)
logging.info(
"read value from etcd:{}".format(
self.etcd_client.get(file_path)
self.etcd_client.get(local_dst)
)
)

Expand Down Expand Up @@ -184,7 +184,9 @@ def download_from_cluster():
return False

try:
kv = self.etcd_client.get(file_path)
kv = self.etcd_client.get(local_src)
logging.info("read value from etcd:{}".format(kv))

if not kv or kv[0] is None:
return False

Expand All @@ -196,9 +198,11 @@ def download_from_cluster():
return False

if copy_from_local():
logging.info("fget_object copy_from_local {}".format(object_name))
return

if download_from_cluster():
logging.info("fget_object download_from_cluster {}".format(object_name))
return

# remote_download or force_remote or copy_from_local and download_from_cluster failed
Expand Down

0 comments on commit b122364

Please sign in to comment.