jo / couch-daemon

High-level os daemon API for CouchDB.
14 stars 2 forks source link

ignore 'compacted' events and others #16

Open regnete opened 8 years ago

regnete commented 8 years ago

https://github.com/jo/couch-daemon/blob/master/lib/dbs.js#L77 should be changed:

        if (change.type === 'deleted' || change.type === 'created')
          push(null, _.extend({ stream: 'dbs' }, change));

The change avoids unneccesary pushes.

We are running into serious problems with the following scenario: When a user logs in the first time, we create a user specific couch db and insert some design documents to that db. this is realized via a seperate node process with nano.

In this case, the couch-daemon (we use couchmagick) gets a massive bulk of events (creation of new db, updates for several design documents, etc.). I don't know why, but then the new db is not watched by couch-daemon, if if the dbs name is covered by the whitelist (/.*/ on our case).

Applying the above patch avoids the problem. I created a pull request: https://github.com/jo/couch-daemon/pull/17