-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add validation event check force delete to a job #2369
Conversation
Changes preview: |
6607dfb
to
930f6ac
Compare
930f6ac
to
be0ac71
Compare
@@ -0,0 +1,40 @@ | |||
class ValidationEventCheckForceDeleteJob < ApplicationJob |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change the name
lib/tasks/check_force_delete.rake
Outdated
task check_force_delete: :environment do | ||
invalid_contacts = Contact.joins(:validation_events).select do |contact| | ||
events = contact.validation_events | ||
events.mx.count >= 3 || events.regex.present? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use MX_CHECK
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check invalid events only
@@ -0,0 +1,11 @@ | |||
desc 'Check Force Delete' | |||
task check_force_delete: :environment do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add args to use batches and schedule delay between jobs
2b027be
to
ee76dea
Compare
To run the job you need to execute the rake task check_force_delete
It's possible to call the task like this:
|
189f5ba
to
58c5182
Compare
No description provided.