Skip to content
This repository has been archived by the owner on Oct 22, 2021. It is now read-only.

Commit

Permalink
pass stale=update_after
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Newson committed Jun 16, 2011
1 parent f0788c3 commit 529a9d0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/chttpd_view.erl
Expand Up @@ -187,6 +187,8 @@ parse_json_view_param({<<"limit">>, V}) when is_integer(V), V > 0 ->
[{limit, V}];
parse_json_view_param({<<"stale">>, <<"ok">>}) ->
[{stale, ok}];
parse_json_view_param({<<"stale">>, <<"update_after">>}) ->
[{stale, update_after}];
parse_json_view_param({<<"descending">>, V}) when is_boolean(V) ->
[{descending, V}];
parse_json_view_param({<<"skip">>, V}) when is_integer(V) ->
Expand Down Expand Up @@ -229,8 +231,11 @@ parse_view_param("count", _Value) ->
throw({query_parse_error, <<"Query parameter 'count' is now 'limit'.">>});
parse_view_param("stale", "ok") ->
[{stale, ok}];
parse_view_param("stale", "update_after") ->
[{stale, update_after}];
parse_view_param("stale", _Value) ->
throw({query_parse_error, <<"stale only available as stale=ok">>});
throw({query_parse_error,
<<"stale only available as stale=ok or as stale=update_after">>});
parse_view_param("update", _Value) ->
throw({query_parse_error, <<"update=false is now stale=ok">>});
parse_view_param("descending", Value) ->
Expand Down

0 comments on commit 529a9d0

Please sign in to comment.