mirror of
https://github.com/Poniverse/Pony.fm.git
synced 2024-11-21 20:48:00 +01:00
Run asynchronous workers in the dev environment.
This better matches how Pony.fm is deployed in production and avoids issues with the database being reconnected in the middle of a database transaction.
This commit is contained in:
parent
b2dba38268
commit
a8e81729fb
4 changed files with 27 additions and 11 deletions
|
@ -11,7 +11,7 @@ DB_PASSWORD=secret
|
|||
ELASTICSEARCH_HOSTS=localhost
|
||||
|
||||
SESSION_HTTPS_ONLY=false
|
||||
QUEUE_DRIVER=sync
|
||||
QUEUE_DRIVER=beanstalkd
|
||||
|
||||
MAIL_DRIVER=smtp
|
||||
MAIL_HOST=mailtrap.io
|
||||
|
|
|
@ -8,8 +8,10 @@ DB_DATABASE=homestead
|
|||
DB_USERNAME=homestead
|
||||
DB_PASSWORD=secret
|
||||
|
||||
ELASTICSEARCH_HOSTS=localhost
|
||||
|
||||
SESSION_HTTPS_ONLY=false
|
||||
QUEUE_DRIVER=sync
|
||||
QUEUE_DRIVER=beanstalkd
|
||||
|
||||
MAIL_DRIVER=smtp
|
||||
MAIL_HOST=mailtrap.io
|
||||
|
|
|
@ -1,14 +1,19 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
echo "Updating config files and restarting services..."
|
||||
echo
|
||||
|
||||
mkdir -p /vagrant/storage/app/datastore
|
||||
|
||||
sudo cp /vagrant/vagrant/pony.fm.nginx.config /etc/nginx/nginx.conf
|
||||
sudo cp /vagrant/vagrant/pony.fm.nginx.site.config /etc/nginx/sites-enabled/pony.fm
|
||||
sudo cp /vagrant/vagrant/pony.fm.nginx.config /etc/nginx/nginx.conf &
|
||||
sudo cp /vagrant/vagrant/pony.fm.nginx.site.config /etc/nginx/sites-enabled/pony.fm &
|
||||
sudo cp /vagrant/vagrant/php-overrides.ini /etc/php/7.0/fpm/99-overrides.ini &
|
||||
sudo cp /vagrant/vagrant/pony.fm.redis.config /etc/redis/redis.conf &
|
||||
sudo cp /vagrant/vagrant/pony.fm.supervisor.config /etc/supervisor/conf.d/pony.fm.conf &
|
||||
wait
|
||||
|
||||
sudo cp /vagrant/vagrant/php-overrides.ini /etc/php/7.0/fpm/99-overrides.ini
|
||||
|
||||
sudo cp /vagrant/vagrant/pony.fm.redis.config /etc/redis/redis.conf
|
||||
|
||||
sudo service elasticsearch restart
|
||||
sudo service nginx restart
|
||||
sudo service php7.0-fpm restart
|
||||
sudo supervisorctl update &
|
||||
sudo service elasticsearch restart &
|
||||
sudo service nginx restart &
|
||||
sudo service php7.0-fpm restart &
|
||||
wait
|
||||
|
|
9
vagrant/pony.fm.supervisor.config
Normal file
9
vagrant/pony.fm.supervisor.config
Normal file
|
@ -0,0 +1,9 @@
|
|||
[program: ponyfm-worker]
|
||||
process_name = %(program_name)s_%(process_num)02d
|
||||
command = php /vagrant/artisan queue:listen --queue=default,notifications,indexing --sleep=3 --tries=3
|
||||
autostart = true
|
||||
autorestart = true
|
||||
user = www-data
|
||||
numprocs = 4
|
||||
redirect_stderr = true
|
||||
stdout_logfile = /vagrant/storage/logs/worker.log
|
Loading…
Reference in a new issue