Changeset 8ee2af5 in OpenWorkouts-current


Ignore:
Timestamp:
Mar 3, 2019, 7:20:29 PM (5 years ago)
Author:
Borja Lopez <borja@…>
Branches:
current
Children:
4fea0a0
Parents:
0398a0c
Message:

Added the scripts and config files to run uwsgi instead of pserve
for development.

This fixes a problem that caused pserve to hang up forever when
several ajax requests were sent to generate screenshots of workout
maps (pserve does not handle concurrent requests very well).

After pulled this change, you can start the app manually using the
uwsgi_start helper::

./bin/uwsgi_start development

Or just use the ./bin/start script, which takes care also of starting
ZEO and several other steps.

Files:
3 added
4 edited

Legend:

Unmodified
Added
Removed
  • .gitignore

    r0398a0c r8ee2af5  
    5959var/log/zeo_stop.err
    6060var/log/zeo_stop.log
     61var/log/uwsgi/uwsgi.log
     62
     63# pid files
    6164var/run/pserve.pid
     65var/run/uwsgi.pid
     66
     67# temp files
     68var/tmp/chameleon/*
     69var/tmp/egg_cache/*
    6270
    6371# JS static external components and libraries
  • bin/install

    r0398a0c r8ee2af5  
    9494}
    9595
     96create_temp_dirs() {
     97    # Creates the tmp directory where cache files are stored
     98    echo "Creating tmp and cache directories ${current}/var/tmp"
     99    mkdir -p ${current}/var/tmp/chameleon
     100    mkdir -p ${current}/var/tmp/egg_cache
     101}
     102
    96103setup_mail_server() {
    97104    echo ""
     
    152159setup_mail_server
    153160create_cron_job
     161create_temp_dirs
    154162setup_start_stop
  • bin/start

    r0398a0c r8ee2af5  
    1313
    1414ctrl_c() {
     15    ./bin/uwsgi_stop
    1516    ./bin/zeo_stop
    1617}
     
    3233# And finally run the server
    3334echo "Starting OpenWorkouts"
    34 pserve --reload development.ini >> var/log/pserve.log 2>> var/log/pserve.err &
    35 echo $! > var/run/pserve.pid
     35./bin/uwsgi_start development
    3636
    3737# show the url where the app is accesible
    38 ow_url=http://`grep listen development.ini |cut -f 3 -d " "`
     38ow_url=http://`grep http etc/uwsgi_development.ini |cut -f 3 -d " "`
    3939echo "Open this url in your browser to access the app: ${ow_url}"
    4040# open ${ow_url}
  • bin/uwsgi_start

    r0398a0c r8ee2af5  
    55
    66case "$1" in
     7    'development')
     8        uwsgi --ini etc/uwsgi_development.ini
     9        echo "Started uwsgi, check var/log/uwsgi/uwsgi.log for more info"
     10        ;;
    711    'staging')
    812        uwsgi --ini etc/uwsgi_staging.ini
Note: See TracChangeset for help on using the changeset viewer.