> On Jan 1, 2015, at 7:59 PM, vf <[email protected]> wrote:
> 
> It's not very obvious that that is a required step after changing the sync 
> function in a way that alters permissions. For example, it's not mentioned in 
> the Sync Function API documentation at all 
> (http://developer.couchbase.com/mobile/develop/guides/sync-gateway/sync-function-api-guide/index.html
>  
> <http://developer.couchbase.com/mobile/develop/guides/sync-gateway/sync-function-api-guide/index.html>).

The "Changing the sync function" section is out of date — it was written for an 
earlier version of SG, in which it would do the equivalent of _resync on launch 
when it detected a change in the sync function from the previous launch. (I've 
just filed an issue against the docs to get this fixed.)

> I notice now that when I change the sync function and restart the server that 
> there's a little blurb outputted into the error log. I'm assuming you don't 
> automatically resync on launch because of the performance implications?

Yes; it can take a long time to resync and the gateway isn't available to serve 
any requests during that time. And some sync function changes won't affect 
existing documents, making that unnecessary. So we decided to put the developer 
in charge of whether to resync or not.

> On a related note, when one changes the sync function using the Admin UI, is 
> it correct to assume that the new sync function is used while the server is 
> running and that the server reverts back to the sync function given in 
> config.json upon restart?

The gateway never writes to the config file. It's strictly read-only. Therefore 
any changes to the sync function (or other database configuration) made at 
runtime will never be persistent across launches. You have to update the config 
file correspondingly.

—Jens

-- 
You received this message because you are subscribed to the Google Groups 
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/3A152FDD-B4DD-4064-9224-FBCE74AA54A3%40couchbase.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to