Changeset 2142a49 in OpenWorkouts-current


Ignore:
Timestamp:
Feb 18, 2019, 9:37:43 PM (5 years ago)
Author:
Borja Lopez <borja@…>
Branches:
current, feature/docs, master
Children:
75383e6
Parents:
591ae81
Message:

Use ZEO in development mode too.

(we will need it once we start running separated process to run tasks,
like sending queued emails)

Adapted bin/start so it handles starting/stopping ZEO instances.

Added some messages to be shown to the user when running the start script,
helping understanding what the script is doing.

Run pserve in the background, instead of leaving it there on the shell.

Added a bin/stop script that stops pserve and ZEO.

Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • bin/start

    r591ae81 r2142a49  
    99env_path=${current}/env
    1010
     11# trap control+c, which is what we use to stop pserve, ensuring ZEO is shut down
     12trap ctrl_c INT
     13
     14ctrl_c() {
     15    ./bin/zeo_stop
     16}
     17
    1118# Activate the virtual env
     19echo "Activating virtual environment"
    1220. ${env_path}/bin/activate
    1321
    1422# Now ensure all python and js packages are up-to-date
     23echo "Installing dependency updates (this may take a moment)"
    1524yes | pip install --upgrade -e ${current}[testing] > /tmp/ow-start.stdout 2> /tmp/ow-start.stderr
    1625./bin/js_deps > /tmp/ow-start.stdout 2> /tmp/ow-start.stderr
    1726
     27# Start ZEO (stop if it is running)
     28echo "Starting database"
     29./bin/zeo_stop >> var/log/zeo_stop.log 2>> var/log/zeo_stop.err &
     30./bin/zeo_start >> var/log/zeo_start.log 2>> var/log/zeo_start.err &
     31
    1832# And finally run the server
    19 pserve --reload development.ini
     33echo "Starting OpenWorkouts"
     34pserve --reload development.ini >> var/log/pserve.log 2>> var/log/pserve.err &
     35echo $! > var/run/pserve.pid
     36
     37# show the url where the app is accesible
     38ow_url=http://`grep listen development.ini |cut -f 3 -d " "`
     39echo "Open this url in your browser to access the app: ${ow_url}"
     40# open ${ow_url}
  • development.ini

    r591ae81 r2142a49  
    1616
    1717# Use this for local, single-process pserve database access
    18 zodbconn.uri = file://%(here)s/var/db/Data.fs?connection_cache_size=20000&blobstorage_dir=%(here)s/var/db/blobs
     18# zodbconn.uri = file://%(here)s/var/db/Data.fs?connection_cache_size=20000&blobstorage_dir=%(here)s/var/db/blobs
    1919# Use this for ZEO
    20 # zodbconn.uri = zeo://%(here)s/var/zeo/zeo.sock?storage=main&blob_dir=%(here)s/var/zeo/blobs&shared_blob_dir=true&connection_pool_size=20
     20zodbconn.uri = zeo://%(here)s/var/zeo/zeo.sock?blob_dir=%(here)s/var/zeo/blobs&shared_blob_dir=true&connection_pool_size=20
    2121
    2222retry.attempts = 3
Note: See TracChangeset for help on using the changeset viewer.