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

    https://github.com/apache/couchdb-couch-mrview/pull/67#discussion_r103232522
  
    --- Diff: src/couch_mrview_cleanup.erl ---
    @@ -41,7 +41,20 @@ run(Db) ->
     
         lists:foreach(fun(FN) ->
             couch_log:debug("Deleting stale view file: ~s", [FN]),
    -        couch_file:delete(RootDir, FN, [sync])
    +        couch_file:delete(RootDir, FN, [sync]),
    +        FilePathList = filename:split(FN),
    +        % delete local purge document if have
    +        [PureFN] = lists:nthtail(length(FilePathList)-1, FilePathList),
    +        PureFNExt = filename:extension(PureFN),
    +        Sig = filename:basename(PureFN, PureFNExt),
    --- End diff --
    
    You should take the last four or five lines and move them to a 
couch_mrview_util function called get_signature_from_filename or something 
similar. We should also probably assert that the signature is something close 
to expected, ie > 16 characters with only hexadecimal characters or something.


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to