couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Shorin <kxe...@gmail.com>
Subject Re: Auto-update views using os_daemon
Date Wed, 31 Jul 2013 12:30:01 GMT
Hi Mike,

Have you look at update notification examples?
http://wiki.apache.org/couchdb/Example%20usages%20of%20DbUpdateNotification

Python version is not very clean, but the idea is the same.
--
,,,^..^,,,


On Wed, Jul 31, 2013 at 4:10 PM, Mike Marino <mmarino@gmail.com> wrote:
> Hi all,
>
> I was looking for a clean way to auto-update views (e.g. after a certain
> number of document inserts) while avoiding running cron jobs.  I chose to
> use an os_daemon script since this ties the daemon explicitly to couch,
> meaning I can stop and start couch and ensure that this script starts with
> it.
>
> I wanted to submit the solution here for comments and suggestions, and also
> because I didn't find a similar script around in the documentation.  I
> would also link on the wiki but I don't yet have rights.
>
> The daemon may be configured to force a view update after a given number of
> document inserts.  This might not fit all use cases well, but it fits ours
> since we have a steady (roughly constant) stream of documents being
> inserted.  Certainly, different requirements could use this script as a
> starting point.
>
> Some possible updates I have in mind include updating to read configuration
> from the couchdb config as well as perhaps some other solution for storing
> credentials for password-protected dbs (suggestions?).
>
> Here is the gist, I welcome your comments or suggestions:
>
> https://gist.github.com/mgmarino/6117801
>
> Cheers,
> Mike

Mime
View raw message