feat: エラーハンドリングのやり方を統一。コメント整理
This commit is contained in:
parent
a108f20a21
commit
c87bee4e9a
@ -4,12 +4,12 @@ ENV TZ="Asia/Tokyo"
|
||||
|
||||
WORKDIR /usr/src/app
|
||||
COPY Pipfile Pipfile.lock ./
|
||||
# apt mysqlパッケージのdpkg次のコマンド注入用
|
||||
# mysql-apt-config をdpkgでインストールする際に標準出力に渡す文字列ファイルをコピー
|
||||
COPY mysql_dpkg_selection.txt ./
|
||||
# 必要なパッケージインストール
|
||||
RUN apt update && apt install -y less vim curl wget gzip unzip sudo lsb-release
|
||||
|
||||
# # mysqlをインストール
|
||||
# mysqlをインストール
|
||||
RUN \
|
||||
wget https://dev.mysql.com/get/mysql-apt-config_0.8.25-1_all.deb && \
|
||||
dpkg -i mysql-apt-config_0.8.25-1_all.deb < mysql_dpkg_selection.txt && \
|
||||
|
||||
@ -88,17 +88,20 @@ def exec():
|
||||
# パイプラインを実行し、エラーハンドリング
|
||||
_, error = mysqldump_process.communicate()
|
||||
if mysqldump_process.returncode != 0:
|
||||
raise BatchOperationException(error.decode('utf-8'))
|
||||
logger.error(f'`mysqldump`実行時にエラーが発生しました。{"" if error is None else error.decode("utf-8")}')
|
||||
return constants.BATCH_EXIT_CODE_SUCCESS
|
||||
|
||||
_, error = gzip_process.communicate()
|
||||
if gzip_process.returncode != 0:
|
||||
raise BatchOperationException(error.decode('utf-8'))
|
||||
logger.error(f'`gzip`実行時にエラーが発生しました。{"" if error is None else error.decode("utf-8")}')
|
||||
return constants.BATCH_EXIT_CODE_SUCCESS
|
||||
|
||||
_, error = s3_cp_process.communicate()
|
||||
if s3_cp_process.returncode != 0:
|
||||
raise BatchOperationException(error.decode('utf-8'))
|
||||
logger.error(f'`aws s3 cp`実行時にエラーが発生しました。{"" if error is None else error.decode("utf-8")}')
|
||||
return constants.BATCH_EXIT_CODE_SUCCESS
|
||||
|
||||
# # dump処理状態区分を正常終了に更新
|
||||
# dump処理状態区分を正常終了に更新
|
||||
try:
|
||||
update_dump_status_kbn_in_complete()
|
||||
except BatchOperationException as e:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user