Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Will this work with Serverless? #76

Open
prcongithub opened this issue Jan 4, 2021 · 1 comment
Open

Will this work with Serverless? #76

prcongithub opened this issue Jan 4, 2021 · 1 comment

Comments

@prcongithub
Copy link

prcongithub commented Jan 4, 2021

We are using AWS Lambda to run our Ruby on Rails based App. We use SQS to trigger lambda function to process background jobs.

Here is how the handler looks like:

def handler(event:, context:)
  begin
      event = event.with_indifferent_access
      event[:Records].each do |record|
        begin
          RequestStore.store[:seller] = record[:seller]
          AsyncHandler.new(record).handle
        rescue Exception => e
          mail_exception(e, record)
        end  
      end
  rescue Exception => e
    mail_exception(e, event)
  end
end

We are facing this weird issue with batch processing of AWS SQS queue where in the RequestStore is getting cleared in the middle of processing of batch of records.

Somewhere inside the AsyncHandler the RequestStore[:seller] becomes nil.

Any ideas here?

@steveklabnik
Copy link
Owner

I personally have no idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants