lib/fulmar/infrastructure/model/transfer/base.rb in fulmar-2.2.3 vs lib/fulmar/infrastructure/model/transfer/base.rb in fulmar-2.2.4
- old
+ new
@@ -1,6 +1,7 @@
require 'fulmar/shell'
+require 'digest'
module Fulmar
module Infrastructure
module Model
module Transfer
@@ -44,9 +45,16 @@
end
def publish
# Placeholder for consistent api, currently only implemented in rsync_with_versions
true
+ end
+
+ # Generate a hash over all relevant config values to allow more precise caching
+ def self.config_hash(config)
+ id_string = self.class.to_s
+ id_string << DEFAULT_CONFIG.keys.map { |key| config[key].to_s }.join('-')
+ Digest::SHA256.hexdigest id_string
end
end
end
end
end