feat: アルトマーク処理ログ見直し
This commit is contained in:
parent
5f508ad123
commit
0491aa77be
@ -34,8 +34,7 @@ def exec_import():
|
||||
|
||||
# ファイルが複数ある場合はエラーとする
|
||||
if len(dat_file_list) > 1:
|
||||
logger.error(f'複数の取込ファイルがあるため、異常終了 ファイル一覧:{dat_file_list}')
|
||||
raise BatchOperationException()
|
||||
raise BatchOperationException(f'複数の取込ファイルがあるため、異常終了 ファイル一覧:{dat_file_list}')
|
||||
|
||||
# ファイルの件数は必ず1件になる
|
||||
dat_file_info = dat_file_list[0]
|
||||
@ -78,7 +77,6 @@ def _import_to_ultmarc_table(dat_file: DatFile):
|
||||
db.connect()
|
||||
# ファイル単位でトランザクションを行う
|
||||
db.begin()
|
||||
logger.info('Transaction BEGIN')
|
||||
mapper_factory = UltmarcTableMapperFactory()
|
||||
# datファイルを1行ずつ処理し、各テーブルへ登録
|
||||
for line in dat_file:
|
||||
@ -96,7 +94,7 @@ def _import_to_ultmarc_table(dat_file: DatFile):
|
||||
logger.warning(e)
|
||||
record = line.records
|
||||
log_message = ','.join([f'"{r}"' for r in record])
|
||||
logger.warning(f'ERROR_LINE: {log_message}')
|
||||
logger.info(f'ERROR_LINE: {log_message}')
|
||||
dat_file.count_up_error()
|
||||
# 処理結果をログに出力する
|
||||
logger.info(f'ultmarc import process RESULT')
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user