Skip to content

Commit

Permalink
Safer marshal dump for miga doctor
Browse files Browse the repository at this point in the history
  • Loading branch information
lmrodriguezr committed Sep 1, 2024
1 parent 800c64c commit c112a41
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/miga/cli/action/doctor/distances.rb
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@ def merge_bidir_tmp(tmp)
end
raise "Incomplete thread dump: #{file}" unless metric == :end
end
File.open("#{file}.marshal", 'w') { |fh| Marshal.dump(dist, fh) }
File.open("#{file}.marshal.tmp", 'w') { |fh| Marshal.dump(dist, fh) }
File.rename("#{file}.marshal.tmp", "#{file}.marshal")
end
cli.say

Expand Down
2 changes: 1 addition & 1 deletion lib/miga/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module MiGA
# - String indicating release status:
# - rc* release candidate, not released as gem
# - [0-9]+ stable release, released as gem
VERSION = [1.3, 20, 4].freeze
VERSION = [1.3, 20, 5].freeze

##
# Nickname for the current major.minor version.
Expand Down

0 comments on commit c112a41

Please sign in to comment.