wco_email 0.1.1.15 → 0.1.1.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tasks/wco_email_tasks.rake +17 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1253b7ed85554d1a4a58ea6a7a080dac2b18abb7ea82cf03ae5c1150d7a0b8d3
|
4
|
+
data.tar.gz: 23e8fbdb9b10428c8d2b5e4e82d5bff4ef26db882f24402b79a8d7dbd4debff8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 885ccc782291190ca038aa9bea5a77a54d823a5bc7266da3248f0453e7b1345a437877e5cc6fd230587082d2e5e4fc23cf200887597021966fb81fe2cda41d33
|
7
|
+
data.tar.gz: c198d369614b352734192d323badaa58fd58be4177954d2ab5473104db533763bfe48fe89bc66cb750b27268a9723bf0ac284a46bfe9d14bab0fd644bb888c5e
|
@@ -37,6 +37,9 @@ namespace :wco_email do
|
|
37
37
|
stub.save!
|
38
38
|
|
39
39
|
WcoEmail::MessageIntakeJob.perform_sync( stub.id.to_s )
|
40
|
+
|
41
|
+
sleep 1 # second
|
42
|
+
print '.'
|
40
43
|
end
|
41
44
|
end
|
42
45
|
|
@@ -107,6 +110,20 @@ namespace :wco_email do
|
|
107
110
|
puts "ok"
|
108
111
|
end
|
109
112
|
|
113
|
+
desc 'remove message duplicates'
|
114
|
+
task remove_message_duplicates: :environment do
|
115
|
+
outs = WcoEmail::Message.collection.aggregate([
|
116
|
+
{"$group" => { "_id" => "$message_id", "count" => { "$sum" => 1 } } },
|
117
|
+
{"$match": {"_id" => { "$ne" => nil } , "count" => {"$gt" => 1} } },
|
118
|
+
{"$project" => {"message_id" => "$_id", "_id" => 0} }
|
119
|
+
])
|
120
|
+
outs = outs.to_a
|
121
|
+
outs.each do |out|
|
122
|
+
WcoEmail::Message.where( message_id: out['message_id'] )[1].destroy!
|
123
|
+
print '.'
|
124
|
+
end
|
125
|
+
end
|
126
|
+
|
110
127
|
desc 'remove duplicates of stubs'
|
111
128
|
task remove_stub_duplicates: :environment do
|
112
129
|
outs = WcoEmail::MessageStub.collection.aggregate([
|