Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/commands/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ def file_list(paths, zone, page, page_size, detached):
srv_list.list_files_with_pagination(paths, zone, page, page_size)


@click.command(name='sync')
@click.command(name='download')
@click.argument('paths', type=click.STRING, nargs=-1)
@click.argument('output_path', type=click.Path(exists=True), nargs=1)
@click.option(
Expand Down
12 changes: 9 additions & 3 deletions app/services/file_manager/file_upload/file_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from typing import Tuple

import click
from click.exceptions import Abort

import app.services.logger_services.log_functions as logger
import app.services.output_manager.message_handler as mhandler
Expand Down Expand Up @@ -194,9 +195,14 @@ def simple_upload( # noqa: C901
elif len(duplicated_file) > 0:
mhandler.SrvOutPutHandler.file_duplication_check_success()
duplicate_warning_format = '\n'.join(duplicated_file)
click.confirm(
customized_error_msg(ECustomizedError.UPLOAD_SKIP_DUPLICATION) % (duplicate_warning_format), abort=True
)
try:
click.confirm(
customized_error_msg(ECustomizedError.UPLOAD_SKIP_DUPLICATION) % (duplicate_warning_format),
abort=True,
)
except Abort:
mhandler.SrvOutPutHandler.cancel_upload()
exit(1)

# here is list of pre upload result. We decided to call pre upload api by batch
pre_upload_infos = []
Expand Down
4 changes: 4 additions & 0 deletions app/services/output_manager/message_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,10 @@ def start_uploading(filename):
"""e.g. Start Uploading: ./test_file."""
logger.info(f'Starting upload of: {filename}')

@staticmethod
def cancel_upload():
logger.warning('Upload cancelled.')

@staticmethod
def start_requests():
"""e.g. start requests."""
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "app"
version = "2.8.0"
version = "2.8.1"
description = "This service is designed to support pilot platform"
authors = ["Indoc Systems"]

Expand Down
2 changes: 1 addition & 1 deletion tests/app/commands/test_entry_point.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def test_file_commands(user_login_true):
'upload': file_put,
'attribute-list': file_check_manifest,
'attribute-export': file_export_manifest,
'sync': file_download,
'download': file_download,
'resume': file_resume,
}
file_commands_object = entry_point.commands.get('file')
Expand Down