Skip to content

Commit 569654a

Browse files
authored
Merge pull request #18 from cwrc/17_logging_fix
Fix logging and duplicate uploads
2 parents 5f875b6 + f50cdb1 commit 569654a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

rootfs/var/www/leaf-isle-bagger/swift/utilities.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ def upload_aip(node_list, aip_dir, swift_options, container_dst, database_csv):
5151
aip_id, aip_path, swift_options, item_options
5252
)
5353
)
54-
upload(swift_conn_dst, dst_objs, container_dst, db_writer)
54+
# May need to be split into batches of "x" if memory usage is too high
55+
upload(swift_conn_dst, dst_objs, container_dst, db_writer)
5556
os.fsync(db_file)
5657

5758

@@ -179,6 +180,7 @@ def upload(swift_conn_dst, dst_objs, container_dst, db_writer=None):
179180
dst_item["object"],
180181
)
181182
# log upload
183+
logging.debug(f"swift stat - [{dst_item}]")
182184
if db_writer:
183185
log_upload(
184186
db_writer,
@@ -333,7 +335,7 @@ def audit_swift_properties(item_id, item_values, dst, checksums, aip_id, aip_pat
333335
logging.error(
334336
(
335337
f"id:[{item_id}] - mismatched modification timestamp [{item_values['changed']}]"
336-
" : [{dst['headers']['x-object-meta-last-mod-timestamp']}]"
338+
f" : [{dst['headers']['x-object-meta-last-mod-timestamp']}]"
337339
)
338340
)
339341
elif (
@@ -345,7 +347,7 @@ def audit_swift_properties(item_id, item_values, dst, checksums, aip_id, aip_pat
345347
logging.error(
346348
(
347349
f"id:[{item_id}] - mismatched checksum [{checksums['sha256sum']}]"
348-
" : [{dst['headers']['x-object-meta-sha256sum']}]"
350+
f" : [{dst['headers']['x-object-meta-sha256sum']}]"
349351
)
350352
)
351353
else:

0 commit comments

Comments
 (0)