Skip to content

Commit

Permalink
Update aws.py
Browse files Browse the repository at this point in the history
  • Loading branch information
dbarrous authored Aug 9, 2024
1 parent 4cbe982 commit b8662a1
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions sdc_aws_utils/aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,22 +448,6 @@ def push_science_file(
file_key=new_file_key,
)

# Get tmp directory
temp_dir = Path(tempfile.gettempdir())

# Clean up temp files in the execution environment between runs
for filename in os.listdir(temp_dir):
file_path = os.path.join(temp_dir, filename)
log.info(f"{file_path}")
try:
# Check if it is a file or directory and remove accordingly
if os.path.isfile(file_path) or os.path.islink(file_path):
os.unlink(file_path) # Remove the file or link
elif os.path.isdir(file_path):
shutil.rmtree(file_path) # Remove the directory and its contents
except Exception as e:
print(f'Failed to delete {file_path}. Reason: {e}')

else:
log.info(
"File Processed Locally - File will not be uploaded,"
Expand Down

0 comments on commit b8662a1

Please sign in to comment.