Class: WcoEmail::MessageIntakeJob
- Inherits:
-
Object
- Object
- WcoEmail::MessageIntakeJob
- Includes:
- Sidekiq::Job
- Defined in:
- app/jobs/wco_email/message_intake_job.rb
Overview
2023-02-26 vp Let’s go 2023-03-07 vp Continue 2023-12-28 vp Continue
Instance Method Summary collapse
-
#perform(id) ⇒ Object
## Mongo::Error::MaxBSONSize: The document exceeds maximum allowed BSON object size after serialization (on 10.138.2.145) object_key = ‘k9n9qo03fii2in3ocj977nac0vj5djn07e110bg1’.
Instance Method Details
#perform(id) ⇒ Object
## Mongo::Error::MaxBSONSize: The document exceeds maximum allowed BSON object size after serialization (on 10.138.2.145)
object_key = 'k9n9qo03fii2in3ocj977nac0vj5djn07e110bg1'
object_key = 'hlbg24s1ov5k7irgmqsrjp0kl95vpik8t1esvs81'
MsgStub.where({ object_key: object_key }).delete
stub = MsgStub.create!({ object_key: object_key })
id = stub.id
Ishapi::EmailMessageIntakeJob.perform_now( stub.id.to_s )
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'app/jobs/wco_email/message_intake_job.rb', line 31 def perform id stub = WcoEmail::MessageStub.find id puts "+++ +++ Performing WcoEmail::MessageIntakeJob for object_key `#{stub.object_key}`." if [ WcoEmail::MessageStub::STATUS_PROCESSED, WcoEmail::MessageStub::STATUS_FAILED ].include?( stub.status ) raise "This stub has already been processed, or errored out: #{stub.id.to_s}." return end begin stub.do_process rescue => err stub.update({ status: WcoEmail::MessageStub::STATUS_FAILED }) puts! err, "WcoEmail::MessageIntakeJob error" ::ExceptionNotifier.notify_exception( err, data: { stub: stub } ) end end |