wco_email 0.1.1.11 → 0.1.1.12

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: 57871044dbe34a83eb21daf21efce6e5f80f58a4d05002e335a5de68708c9db2
4
- data.tar.gz: e3813b3170e891df5f8d49168b319823f7eaa935ca4aa2f4e21606eba5cbf49c
3
+ metadata.gz: 12cf9a51987708d2c99caa370d30c2fe09466831e570e76b6ec3d4f43b6e8747
4
+ data.tar.gz: 681fee4ecf20113fb5ef901042326b030de4fa4a08016f9cc31fb5ad1e2e6acd
5
5
  SHA512:
6
- metadata.gz: 67012b8a6f4a425ebc669e3b31aef2ae94305e59774052e1e122a98f9f1878a48d890dca3f2f1661e0a53e818abe76bfe4565b85c7c5e9bd9517c60d46e49750
7
- data.tar.gz: e1958e70b7e6f17f4c3507dee615fd21567385d51097b51cbdaafd4493f76a40b7c94eae06e6da3057db4c2b54bbd0717157fe94e51e9ae0225c15acb3c3db50
6
+ metadata.gz: 27452f09a3756eb4622b51fdd165baa5843bf045fc3f1de1e9b06f66e5954cb321a1dcbe6eebb0a63881809597053906035d05c8dabb20c2c05d2382cb024429
7
+ data.tar.gz: 04c4c2b58ae84f428ff0885630b18e21cda3bbb702e661dd29cd0b2424a67987ba8e1f10daed09375ccdf4ccb859761a96fcdbc59917695041f31bd8f66743fb
@@ -32,7 +32,7 @@ class WcoEmail::MessageIntakeJob
32
32
  stub = WcoEmail::MessageStub.find id
33
33
  puts "+++ +++ Performing WcoEmail::MessageIntakeJob for object_key `#{stub.object_key}`."
34
34
 
35
- if stub.status != WcoEmail::MessageStub::STATUS_PENDING
35
+ if [ WcoEmail::MessageStub::STATUS_PROCESSED, WcoEmail::MessageStub::STATUS_FAILED ].include?( stub.status )
36
36
  raise "This stub has already been processed: #{stub.id.to_s}."
37
37
  return
38
38
  end
@@ -40,6 +40,7 @@ class WcoEmail::MessageIntakeJob
40
40
  begin
41
41
  stub.do_process
42
42
  rescue => err
43
+ stub.update({ status: WcoEmail::MessageStub::STATUS_FAILED })
43
44
  puts! err, "WcoEmail::MessageIntakeJob error"
44
45
  ::ExceptionNotifier.notify_exception(
45
46
  err,
@@ -4,14 +4,15 @@ namespace :wco_email do
4
4
  ##
5
5
  ## @stub = WcoEmail::MessageStub.find_by object_key: '2021-10-18T18_41_17Fanand_phoenixwebgroup_co'
6
6
  ##
7
- desc 'churn_n_stubs n=<num> [tagname=<some-new-slug>] [process_images=<false|true>]'
7
+ desc 'churn_n_stubs n=<num> [tagname=<some-new-slug>] [process_images=<false|true>] [status=<status>]'
8
8
  task churn_n_stubs: :environment do
9
9
 
10
10
  ## Usage
11
11
  if !ENV['n']
12
12
  puts ""
13
- puts "Usage: churn_n_stubs n=<num> [tagname=<some-new-slug>] [process_images=<false|true>] "
13
+ puts "Usage: churn_n_stubs n=<num> [tagname=<some-new-slug>] [process_images=<false|true>] [status=<status>] "
14
14
  puts "DOES NOT PROCESS IMAGES BY DEFAULT"
15
+ puts "status can be something other than STATUS_PENDING"
15
16
  puts ""
16
17
  exit 22
17
18
  end
@@ -22,8 +23,11 @@ namespace :wco_email do
22
23
 
23
24
  process_images = ENV['process_images'] == 'true'
24
25
 
26
+ status = ENV['status']
27
+ status ||= WcoEmail::MessageStub::STATUS_PENDING
28
+
25
29
  n = ENV['n'].to_i
26
- stubs = WcoEmail::MessageStub.pending.limit n
30
+ stubs = WcoEmail::MessageStub.where( status: status ).limit n
27
31
  stubs.each_with_index do |stub, idx|
28
32
  puts "+++ +++ churning ##{idx+1} object_key: #{stub.object_key}"
29
33
 
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.11
4
+ version: 0.1.1.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Pudeyev