I am using que gem for sending emails asynchronously. I am using elastic-beanstalk and puma as the server. As per the puma's documentation I find out that there are two ways to provide custom config to the puma (which i have tried)
- putting config/puma.rb
- putting config/puma/production.rb
what i want to achieve is this. I did not find any way to override the on_worker_boot apart from this. What else I have tried - Writing custom script (.ebextensions) to kill existing process with que:work and with starting again on post load environment
files:
"/opt/elasticbeanstalk/hooks/appdeploy/post/99_restart_que.sh":
mode: "000755"
owner: root
group: root
content: |
#!/usr/bin/env bash
set -xe
# Loading environment data
EB_SCRIPT_DIR=$(/opt/elasticbeanstalk/bin/get-config container -k script_dir)
EB_SUPPORT_DIR=$(/opt/elasticbeanstalk/bin/get-config container -k support_dir)
EB_APP_USER=$(/opt/elasticbeanstalk/bin/get-config container -k app_user)
EB_APP_CURRENT_DIR=$(/opt/elasticbeanstalk/bin/get-config container -k app_deploy_dir)
. $EB_SUPPORT_DIR/envvars
. $EB_SCRIPT_DIR/use-app-ruby.sh
cd $EB_APP_CURRENT_DIR
su -s /bin/bash -c "pkill -f que:work" $EB_APP_USER
echo 'REAPED que:work processes.'
su -s /bin/bash -c "bundle exec rake que:work" $EB_APP_USER
But no luck so far.. Are there any other alternatives to set the Que.mode = :async after puma starts?
Aucun commentaire:
Enregistrer un commentaire