Skip to content

Commit

Permalink
Fix syntax error, unexpected `end', expecting end-of-input
Browse files Browse the repository at this point in the history
  • Loading branch information
teutat3s committed Jul 19, 2023
1 parent 360c670 commit f4b5670
Showing 1 changed file with 26 additions and 27 deletions.
53 changes: 26 additions & 27 deletions lib/tasks/errbit/database.rake
Original file line number Diff line number Diff line change
Expand Up @@ -22,39 +22,38 @@ namespace :errbit do


desc "Delete old errors from the database."
task :clear_old => :environment do
require 'old_problem_clearer'
puts "=== Cleared #{OldProblemClearer.new.execute} old errors from the database."
end

desc "Regenerate fingerprints"
task :regenerate_fingerprints => :environment do
puts "Regenerating Err fingerprints"
Err.create_indexes
Err.all.each do |err|
next if err.notices.count == 0 || err.app.nil?
task :clear_old => :environment do
require 'old_problem_clearer'
puts "=== Cleared #{OldProblemClearer.new.execute} old errors from the database."
end

fingerprint = ErrorReport.fingerprint_strategy.generate(err.notices.first, err.app.api_key)
next if fingerprint == err.fingerprint
desc "Regenerate fingerprints"
task :regenerate_fingerprints => :environment do
puts "Regenerating Err fingerprints"
Err.create_indexes
Err.all.each do |err|
next if err.notices.count == 0 || err.app.nil?

# Migrate notices to the new err and remove the old err
new_err = err.app.find_or_create_err!(
:error_class => err.problem.error_class,
:environment => err.problem.environment,
:fingerprint => fingerprint
)
fingerprint = ErrorReport.fingerprint_strategy.generate(err.notices.first, err.app.api_key)
next if fingerprint == err.fingerprint

err.notices.each do |notice|
notice.update_attribute(:err_id, new_err.id)
end
# Migrate notices to the new err and remove the old err
new_err = err.app.find_or_create_err!(
:error_class => err.problem.error_class,
:environment => err.problem.environment,
:fingerprint => fingerprint
)

err.problem.update_attributes(:notices_count => err.problem.notices.count)
if err.problem.notices_count == 0
err.problem.destroy
end
err.notices.each do |notice|
notice.update_attribute(:err_id, new_err.id)
end

err.destroy
err.problem.update_attributes(:notices_count => err.problem.notices.count)
if err.problem.notices_count == 0
err.problem.destroy
end

err.destroy
end
end

Expand Down

0 comments on commit f4b5670

Please sign in to comment.