Skip to content

Commit

Permalink
Merge pull request #312 from kjsanger/fix/publich-overwrite-metadata
Browse files Browse the repository at this point in the history
Fix publisher to be better at metadata consistency
  • Loading branch information
kjsanger authored Aug 29, 2024
2 parents 1de1466 + af1a7d6 commit 6a016da
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/WTSI/NPG/iRODS/Publisher.pm
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,10 @@ sub _publish_file_overwrite {
$self->info("Skipping publication of '$local_path' to '$remote_path': ",
"(checksum unchanged): local MD5 is '$local_md5', ",
"remote is MD5: '$pre_remote_md5'");
# Ensure the metadata are up-to-date, for consistency
$self->_supersede($obj,
$self->make_md5_metadata($pre_remote_md5),
$self->make_type_metadata($remote_path));
}
else {
$self->info("Re-publishing '$local_path' to '$remote_path' ",
Expand All @@ -378,8 +382,9 @@ sub _publish_file_overwrite {
# Add modification metadata only if successful
$num_meta_errors +=
$self->_supersede($obj,
$self->make_modification_metadata($timestamp),
$self->make_md5_metadata($post_remote_md5),
$self->make_modification_metadata($timestamp));
$self->make_type_metadata($remote_path));
} catch {
$num_write_errors++;
$self->error(q[Failed to overwrite existing data object at '],
Expand Down

0 comments on commit 6a016da

Please sign in to comment.