You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by Zachary Zolton <za...@gmail.com> on 2010/11/15 16:58:38 UTC

Re: scripts in [update_notification] section ?

I think your update notification script is not supposed to exit every
time there's a change. It's supposed to stay running in a loop where
you get the next line from standard input (for each update), only
quitting when that stream gets closed.

That said, the update notification feature should generally be
considered deprecated by the newer changes API:
http://guide.couchdb.org/draft/notifications.html

Cheers,
Zach

On Mon, Nov 15, 2010 at 9:26 AM, cdr53x <cd...@free.fr> wrote:
> Hi,
>
> I read the article concerning the view updates in the wiki
>  (http://wiki.apache.org/couchdb/Regenerating_views_on_update) and tried to
> test this.
>
> I just put a basic script  that simply logs a message in my conf.ini :
>
> [update_notification]
> view_update=/home/tests/couchdb/deployed/bin/update_views.rb
>
> After restarting couch, I noticed that this script is invoked _all_ the
> time, i.e as soons as the script finishes couch starts another one. And no
> insertions/updates are performed on the db.
>
> So there seems to be no relation between the script execution and the fact
> that a document has been inserted or updated.
>
> Is this the expected behavior or a bug ?
>
> Regards,
>
> cdrx
>
>

Re: scripts in [update_notification] section ?

Posted by cdr53x <cd...@free.fr>.
On 11/15/2010 04:58 PM, Zachary Zolton wrote:
> I think your update notification script is not supposed to exit every
> time there's a change. It's supposed to stay running in a loop where
> you get the next line from standard input (for each update), only
> quitting when that stream gets closed.
>    
You're right, it should read from the input and stay in the loop as the 
example shows.

I adpted and tested the script and it seems to work.

Thanks,

cdrx



Re: scripts in [update_notification] section ?

Posted by Jan Lehnardt <ja...@apache.org>.
On 15 Nov 2010, at 16:58, Zachary Zolton wrote:

> I think your update notification script is not supposed to exit every
> time there's a change. It's supposed to stay running in a loop where
> you get the next line from standard input (for each update), only
> quitting when that stream gets closed.

That is correct.

> That said, the update notification feature should generally be
> considered deprecated by the newer changes API:
> http://guide.couchdb.org/draft/notifications.html

That is not correct :) — The two APIs serve different purposes and
none of them is deprecated.

That said, a /_db_update handler that acts like DbUpdateNotification
but over HTTP would be neat.

Cheers
Jan
-- 



> 
> Cheers,
> Zach
> 
> On Mon, Nov 15, 2010 at 9:26 AM, cdr53x <cd...@free.fr> wrote:
>> Hi,
>> 
>> I read the article concerning the view updates in the wiki
>>  (http://wiki.apache.org/couchdb/Regenerating_views_on_update) and tried to
>> test this.
>> 
>> I just put a basic script  that simply logs a message in my conf.ini :
>> 
>> [update_notification]
>> view_update=/home/tests/couchdb/deployed/bin/update_views.rb
>> 
>> After restarting couch, I noticed that this script is invoked _all_ the
>> time, i.e as soons as the script finishes couch starts another one. And no
>> insertions/updates are performed on the db.
>> 
>> So there seems to be no relation between the script execution and the fact
>> that a document has been inserted or updated.
>> 
>> Is this the expected behavior or a bug ?
>> 
>> Regards,
>> 
>> cdrx
>> 
>>