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 +4 -4
- data/app/jobs/wco_email/message_intake_job.rb +2 -1
- data/lib/tasks/wco_email_tasks.rake +7 -3
- 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: 12cf9a51987708d2c99caa370d30c2fe09466831e570e76b6ec3d4f43b6e8747
|
4
|
+
data.tar.gz: 681fee4ecf20113fb5ef901042326b030de4fa4a08016f9cc31fb5ad1e2e6acd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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.
|
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
|
|