Skip to content
This repository has been archived by the owner on Sep 19, 2019. It is now read-only.

Allow rpc changes requests to fetch ddoc from local cache #168

Merged
merged 2 commits into from Mar 2, 2016

Conversation

chewbranca
Copy link
Member

No description provided.

@chewbranca
Copy link
Member Author

Companion PR out in https://github.com/cloudant/dbcore/pull/265.

#changes_args{dir=Dir} = Args = lists:keyfind(changes_args, 1, Options),
#changes_args{dir=Dir, filter=Filter} = Args0 = lists:keyfind(changes_args, 1, Options),
Args = case Filter of
{fetch, Style, {DbArg, JsonReq, DDocId, FName}} ->
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like you need a when is_binary(DDocId) here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose it wouldn't hurt to add that in, but right now the only caller sends a binary. Do you think it's better to fail loudly with a pattern match error here, or silently skip the fetch command and load the slow way? I think I would honestly rather see this throw a 500 than fail silently back to the slow approach.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also I think we should move this to couch_changes as an API function. I don't like introspecting that filter tuple outside of the module that defines it.

@chewbranca chewbranca force-pushed the 58187-dont-send-ddocs-over-the-wire branch from 99e27ac to d0f2081 Compare February 26, 2016 19:23
@davisp
Copy link
Contributor

davisp commented Mar 2, 2016

+1

chewbranca added a commit that referenced this pull request Mar 2, 2016
…wire

Allow rpc changes requests to fetch ddoc from local cache
@chewbranca chewbranca merged commit a399a07 into master Mar 2, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants