Skip to content

Commit

Permalink
Replace return with next and message to stdout (#923)
Browse files Browse the repository at this point in the history
  • Loading branch information
ajkiessl authored Dec 18, 2023
1 parent df34737 commit a67dd40
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/tasks/email_notifications.rake
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ namespace :email_notifications do

desc 'Send reminder emails about potential open access publications to applicable users up to the number passed as an argument (or the configured number as default)'
task :send_capped_open_access_reminders, [:cap] => :environment do |_task, args|
return 'Notifications are turned off' if OANotificationSetting.not_active?
if OANotificationSetting.not_active?
$stdout.puts 'Notifications are turned off'
next
end

cap = (args[:cap] || OANotificationSetting.email_cap).to_i
OpenAccessNotifier.new.send_notifications_with_cap(cap)
Expand Down

0 comments on commit a67dd40

Please sign in to comment.