lib/eco/api/usecases/graphql/samples/location/command/service/tree_update.rb in eco-helpers-3.0.6 vs lib/eco/api/usecases/graphql/samples/location/command/service/tree_update.rb in eco-helpers-3.0.7
- old
+ new
@@ -5,31 +5,34 @@
# Whether to stop or continue on command fail
FORCE_CONTINUE = false
class << self
def included(base)
- super(base)
+ super
base.send :include, Eco::API::UseCases::GraphQL::Samples::Location::Service::TreeDiff
base.send :include, Eco::API::UseCases::GraphQL::Samples::Location::Command::DSL
base.send :include, Eco::API::UseCases::GraphQL::Utils::Sftp
base.send :include, InstanceMethods
end
end
module InstanceMethods
def process
- super
+ with_error_handling do
+ super
+ end
ensure
- rescued { re_archive }
+ rescued { re_archive } unless error_raised?
rescued { email_digest('TagTree Update') }
end
# Before closing, run RE-ARCHIVE: those that where unarchived via archivedToken
# that should remain archived.
# @note this is an additional necessary step
def re_archive
return if simulate?
+ return if error_raised?
stage = :rearchive
nodes_diff_class.new(
hash_list(current_tree),
@@ -83,12 +86,12 @@
def email_digest(title)
return if simulate?
return if options.dig(:workflow, :no_email)
- digest_msgs = logger.cache.logs(level: %i[info error warn])
- exception = exception ? " - Exception!" : ''
- subject = "#{config.active_enviro} - #{title}#{exception}"
+ digest_msgs = logger.cache.logs(level: %i[info error warn])
+ str_exception = exception ? " - Exception!" : ''
+ subject = "#{config.active_enviro} - #{title}#{str_exception}"
session.mail(subject: subject, body: digest_msgs.join)
end
def print_diff_details?
false