Node process that runs background tasks for medic-webapp
For 2.15 and greater versions of medic-webapp we have merged medic-api and medic-sentinel repositories directly into the main repo.
This repo exists only to service 2.14.x builds and below, and will eventually be archived.
Get node deps with npm install
.
node server.js
Debug mode:
node server.js debug
grunt test
Sentinel listens to the CouchDB changes feed and runs a set of transitions on on a given database change. It also manages scheduled tasks like message schedules.
Export a COUCH_URL
env variable so sentinel knows what database to use. e.g.
export COUCH_URL='http://admin:pass@localhost:5984/medic'
Throughout this document we will be referring to ddoc
. Here we mean the
currently deployed _design/medic
ddoc from medic-webapp.
Default settings values are in defaults.js
. On initial start, and when there
are changes to the ddoc, sentinel reads ddoc.app_settings
to determine
configuration.
By default all transitions are disabled, to enable a transition modify the
transitions
property on ddoc.app_settings
.