lib/eco-rake/lib/people/sync_launch.rb in eco-rake-0.2.4 vs lib/eco-rake/lib/people/sync_launch.rb in eco-rake-0.2.5
- old
+ new
@@ -3,16 +3,17 @@
module People
# @todo on_error_email to ensure always notified
# @todo ping some back-end that it was run
# - Should be able to log at debug level.
class SyncLaunch < EcoRake::Lib::People::BaseTask
- ADDITIONAL_OPTIONS = %i[only_stats no_policy simulate].freeze
+ ADDITIONAL_OPTIONS = %i[only_stats no_policy simulate no_email].freeze
FORWARD_RULES = {
schema: ->(schema) { "-schema-id \"#{schema}\"" },
only_stats: '-feed-only-stats',
no_policy: '-skip-batch-policy',
- simulate: '-simulate'
+ simulate: '-simulate',
+ no_email: '-no-email'
}.freeze
attr_const :target_enviro, required: true
option_reopen :enviro, default_lookup: :target_enviro
@@ -49,12 +50,15 @@
File.delete(file)
end
end
def missing_files_notify
- puts "Missing files to be processed"
+ msg = "Missing files to be processed"
+ puts msg
exit 1 if options[:simulate]
+ exit 1 if options[:no_email]
exit 1 unless inbox = mail_to
+
email_missing_files(enviro: target_enviro, to: inbox)
exit 1
end
# @yield [cmd] do something to extend the command