Skip to content

Commit 9d08996

Browse files
committed
Fix to avoid initiating s3 client repeatedly
1 parent 1758c37 commit 9d08996

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

charon/pkgs/npm.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ def handle_npm_uploading(
8787
8888
Returns the directory used for archive processing and if uploading is successful
8989
"""
90+
client = S3Client(aws_profile=aws_profile, dry_run=dry_run)
9091
for target in targets:
9192
bucket_ = target[1]
9293
prefix__ = remove_prefix(target[2], "/")
@@ -99,16 +100,13 @@ def handle_npm_uploading(
99100
sys.exit(1)
100101
valid_dirs = __get_path_tree(valid_paths, target_dir)
101102

102-
# main_target = targets[0]
103-
client = S3Client(aws_profile=aws_profile, dry_run=dry_run)
104103
logger.info("Start uploading files to s3 buckets: %s", bucket_)
105104
failed_files = client.upload_files(
106105
file_paths=valid_paths,
107106
targets=[(bucket_, prefix__)],
108107
product=product,
109108
root=target_dir
110109
)
111-
112110
logger.info("Files uploading done\n")
113111

114112
succeeded = True

0 commit comments

Comments
 (0)