Skip to content

Commit

Permalink
Tweak minio migration script again
Browse files Browse the repository at this point in the history
  • Loading branch information
audiodude committed Jan 6, 2025
1 parent a5fae2e commit 0eef3b9
Showing 1 changed file with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import logging
import os
import shutil

Expand All @@ -13,6 +14,9 @@
FROM_PREVIEW_DIR = os.environ.get('FROM_PREVIEW_DIR', '/data/preview-data')
FROM_DATA_DIR = os.environ.get('FROM_DATA_DIR', '/data/song-data')

urllib_logger = logging.getLogger('urllib3.connectionpool')
urllib_logger.setLevel(logging.WARNING)


def upload_local_files():
print('Querying sites...')
Expand All @@ -28,21 +32,27 @@ def upload_local_files():
cache_dir_path = cache_dir(preview_dir_path, str(site.id))

try:
print(f'Uploading site {site_dir_path} to object storage')
print(
f'Uploading site {from_site_dir_path} to object storage at {site_dir_path}'
)
object_storage.upload_dir_recursively(path=from_site_dir_path,
output_path=site_dir_path)
except AssertionError:
print(' X - Directory not found')

try:
print(f'Uploading {build_dir_path} to object storage')
print(
f'Uploading build {from_build_dir_path} to object storage at {build_dir_path}'
)
object_storage.upload_dir_recursively(path=from_build_dir_path,
output_path=build_dir_path)
except AssertionError:
print(' X - Directory not found')

try:
print(f'Uploading {cache_dir_path} to object storage')
print(
f'Uploading {from_cache_dir_path} to object storage at {cache_dir_path}'
)
object_storage.upload_dir_recursively(path=from_cache_dir_path,
output_path=cache_dir_path)
except AssertionError:
Expand Down

0 comments on commit 0eef3b9

Please sign in to comment.