Skip to content

Commit 77e332f

Browse files
committed
Add rake task to retrain all classifier
1 parent 7307372 commit 77e332f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/tasks/data_migration.rake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,10 @@ namespace :data_migration do
3434

3535
puts "\n Successfully backfilled message_hash for #{total_count} records."
3636
end
37+
desc "Retrain all classifier"
38+
task retrain_all_classifier: :environment do
39+
GroupClassifierState.for_public.find_each do |classifier|
40+
SpamClassifierService.rebuild_for_group(classifier.group_id, classifier.group_name)
41+
end
42+
end
3743
end

0 commit comments

Comments
 (0)