Helpful-commands
Log specs queries
Add VERBOSE_QUERY_LOGS=1 to your .env.test.local
Sidekiq
Handle failed queue jobs
Evaluate failed jobs' classes
jobs = []
Sidekiq::Failures::FailureSet.new.each { |e| jobs << e.item['wrapped'] }; nil
jobs.uniq!
Evaluate failed jobs' exceptions
jobs = []
Sidekiq::Failures::FailureSet.new.each { |e| jobs << e.item['error_class'] }; nil
jobs.uniq!
Load them
jobs = []
Sidekiq::Failures::FailureSet.new.each { |j| jobs << j if (j.item['wrapped'] == 'JobClassName') }; nil
Sidekiq::Failures::FailureSet.new.each { |j| jobs << j if j.item['error_class'] == 'Exception' }; nil
Sidekiq::Failures::FailureSet.new.each { |j| jobs << j if (j.queue == 'QueueName') }; nil
Remove or requeue
jobs.each(&:delete)
jobs.each(&:retry)
AWS S3 CLI
Assuming docker is installed and running in your machine, it's possible to launch and use a container with aws-cli installed using:
docker run --rm -it -e AWS_ACCESS_KEY_ID={key} -e AWS_SECRET_ACCESS_KEY={secret} --entrypoint /bin/bash amazon/aws-cli
Once inside the container, all S3 commands can be run:
aws s3 ls s3://my-bucket