Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 86EF810A0C for ; Wed, 31 Jul 2013 12:43:25 +0000 (UTC) Received: (qmail 55596 invoked by uid 500); 31 Jul 2013 12:43:24 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 55567 invoked by uid 500); 31 Jul 2013 12:43:23 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 55559 invoked by uid 99); 31 Jul 2013 12:43:23 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 31 Jul 2013 12:43:23 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of mmarino@gmail.com designates 74.125.82.175 as permitted sender) Received: from [74.125.82.175] (HELO mail-we0-f175.google.com) (74.125.82.175) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 31 Jul 2013 12:43:19 +0000 Received: by mail-we0-f175.google.com with SMTP id q58so564694wes.34 for ; Wed, 31 Jul 2013 05:42:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=AiSBvWa+Tl8VeOhqYcg0J1utB4tHLgMXmF7Z1gCvaFY=; b=vknb17YOt9bK798lov9B5KAxvYIhsoMgmbOQN/AsIjMzXwNSSvcgdeJsyhyA1eWCmR LlocuE+UuATa5EqU9cG8daTLVNyplVSc71nmkYJvKpLtjzz5CJHKNIhEFzLsE4FOMLPI Xk0vKnoSObTFBbLZjhgBUNM7Vuhkmn8bqkZMiJJp+dDFs9dEMIHcZ+J/SNtuCOyyQrhF Bv1nCL3vDEBL+J/1nqSCaptmW3HG2WuSVgLhzvpZDaQ7mkpEB6zaZqPcqONdf2jQcQf9 nQAzg9gJhRrCRVJVpScue7Jl84rQQrjgLsBJbXBqmDlNqChE9aAbYOqxzPJuqiIc/Qom IEsw== X-Received: by 10.180.75.144 with SMTP id c16mr3587711wiw.1.1375274577942; Wed, 31 Jul 2013 05:42:57 -0700 (PDT) MIME-Version: 1.0 Received: by 10.194.109.197 with HTTP; Wed, 31 Jul 2013 05:42:37 -0700 (PDT) In-Reply-To: References: From: Mike Marino Date: Wed, 31 Jul 2013 14:42:37 +0200 Message-ID: Subject: Re: Auto-update views using os_daemon To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=f46d04388df3b001d304e2ce1092 X-Virus-Checked: Checked by ClamAV on apache.org --f46d04388df3b001d304e2ce1092 Content-Type: text/plain; charset=ISO-8859-1 Hi Alex, Thanks, that's basically exactly what I wanted to do, I just couldn't find that functionality through my searches. I will modify my script to use that instead. Cheers, Mike On Wed, Jul 31, 2013 at 2:30 PM, Alexander Shorin wrote: > 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 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 > --f46d04388df3b001d304e2ce1092--