func (sc *ServerContext) applySyncFunction(dbcontext *db.DatabaseContext, syncFn string) error { changed, err := dbcontext.UpdateSyncFun(syncFn) if err != nil || !changed { return err } // Sync function has changed: base.Logf("**NOTE:** %q's sync function has changed. The new function may assign different channels to documents, or permissions to users. You may want to re-sync the database to update these.", dbcontext.Name) return nil }