You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by davisp <gi...@git.apache.org> on 2017/03/14 14:42:39 UTC

[GitHub] couchdb-couch-mrview pull request #67: 68276 new purge api

Github user davisp commented on a diff in the pull request:

    https://github.com/apache/couchdb-couch-mrview/pull/67#discussion_r105926127
  
    --- Diff: src/couch_mrview_index.erl ---
    @@ -204,3 +208,56 @@ index_file_exists(State) ->
         } = State,
         IndexFName = couch_mrview_util:index_file(DbName, Sig),
         filelib:is_file(IndexFName).
    +
    +
    +update_local_purge_doc(Db, State) ->
    +    Sig = couch_index_util:hexsig(get(signature, State)),
    +    Doc = couch_doc:from_json_obj({[
    +        {<<"_id">>, couch_mrview_util:get_local_purge_doc_id(Sig)},
    +        {<<"purge_seq">>, get(purge_seq, State)},
    +        {<<"timestamp_utc">>, list_to_binary(couch_util:utc_string())},
    +        {<<"verify_module">>, <<"couch_mrview_index">>},
    +        {<<"verify_function">>, <<"verify_index_exists">>},
    +        {<<"verify_options">>, {[
    +            {<<"dbname">>, get(db_name, State)},
    +            {<<"indexname">>, get(idx_name, State)},
    +            {<<"signature">>, Sig}
    +        ]}},
    +        {<<"type">>, <<"mrview">>}
    +    ]}),
    +    couch_db:update_doc(Db, Doc, []).
    +
    +
    +verify_index_exists(Options) ->
    +    ShardDbName = couch_mrview_util:get_value_from_options(<<"dbname">>, Options),
    +    IndexName = couch_mrview_util:get_value_from_options(<<"indexname">>, Options),
    +    SigInLocal = couch_mrview_util:get_value_from_options(<<"signature">>, Options),
    +    case couch_db:open_int(ShardDbName, []) of
    +        {ok, Db} ->
    +            try
    +                DbName =mem3:dbname(Db#db.name),
    --- End diff --
    
    Missing space after = operator.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---