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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3e60e5717005c4eeedca0acf6cc252d756c1c89207e33433461c61375e0cbf6d
4
- data.tar.gz: 8b9795b50a69d6cf743e41853981b30440ebee9b23e8a96b936ae281d76c42f7
3
+ metadata.gz: 1253b7ed85554d1a4a58ea6a7a080dac2b18abb7ea82cf03ae5c1150d7a0b8d3
4
+ data.tar.gz: 23e8fbdb9b10428c8d2b5e4e82d5bff4ef26db882f24402b79a8d7dbd4debff8
5
5
  SHA512:
6
- metadata.gz: dc1c955765c2190d06dd36ed77ffa242f94a8974f08c28e05b5ad0423df1ddc2aaae1dc3bca230589f527f6fbf65557b6247eb4cf9757bbb38df1b2c421879d6
7
- data.tar.gz: d0c3b726e150d2323f3042933cdee095b02517aaa9069e0050721dbe24750f87952ab27996c3827d517c1189bab1d0c4096a693adcdc9763ddb8dde2e9ecf0c8
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([
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wco_email
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1.15
4
+ version: 0.1.1.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Pudeyev