cron: fix undefined variable in exception handler (again)
Fixup for a1d4408c2.
This commit is contained in:
@@ -32,7 +32,7 @@ module DanbooruMaintenance
|
||||
ApplicationRecord.connection.verify!
|
||||
job.perform_later
|
||||
rescue Exception => e # rubocop:disable Lint/RescueException
|
||||
DanbooruLogger.log(exception)
|
||||
DanbooruLogger.log(e)
|
||||
raise e if Rails.env.test?
|
||||
end
|
||||
end
|
||||
|
||||
@@ -8,6 +8,16 @@ class DanbooruMaintenanceTest < ActiveSupport::TestCase
|
||||
perform_enqueued_jobs
|
||||
end
|
||||
end
|
||||
|
||||
should "log errors" do
|
||||
assert_raise(RuntimeError) do
|
||||
PrunePostsJob.stubs(:perform_later).raises(RuntimeError)
|
||||
DanbooruLogger.expects(:log)
|
||||
|
||||
DanbooruMaintenance.hourly
|
||||
perform_enqueued_jobs
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context "daily maintenance" do
|
||||
|
||||
Reference in New Issue
Block a user