Reset anomaly flag after sending emails

This commit is contained in:
Maximilian Grundke
2017-12-10 19:25:05 +01:00
parent a6744c20e6
commit 041f080191

View File

@ -38,7 +38,14 @@ namespace :detect_exercise_anomalies do
working_time > average * MAX_TIME_FACTOR or working_time < average * MIN_TIME_FACTOR working_time > average * MAX_TIME_FACTOR or working_time < average * MIN_TIME_FACTOR
end end
puts "\t\tSending E-Mail..."
UserMailer.exercise_anomaly_detected(collection, anomalies).deliver_now UserMailer.exercise_anomaly_detected(collection, anomalies).deliver_now
puts "\t\tResetting flag..."
collection.use_anomaly_detection = false
collection.save!
puts "\t\tDone."
end end
end end