iilyak commented on a change in pull request #3481:
URL: https://github.com/apache/couchdb/pull/3481#discussion_r604623332



##########
File path: src/couch_js/src/couch_js.erl
##########
@@ -49,3 +52,15 @@ map_docs(Proc, Docs) ->
         end, Results),
         {Doc#doc.id, Tupled}
     end, Docs)}.
+
+acquire_context() ->
+    Ctx = couch_query_servers:get_os_process(?JS),
+    {ok, Ctx}.
+
+
+release_context(Proc) ->
+    couch_js_query_servers:ret_os_process(Proc).
+
+
+try_compile(Proc, FunName, FunSrc) ->
+    couch_query_servers:try_compile(Proc, map, FunName, FunSrc).

Review comment:
       Never mind the idea of passing the `map | reduce` in the context. I can 
see now that we are using both in `couch_mrview:validate/3`
   
   - map on [line 
192](https://github.com/apache/couchdb/pull/3481/files#diff-637f0ee4524b44455ad1fcbfa99fdbdc757c0a0c7a1bd462f4e9b5f51a548dc9L192)
   - reduce on [line 
206](https://github.com/apache/couchdb/pull/3481/files#diff-637f0ee4524b44455ad1fcbfa99fdbdc757c0a0c7a1bd462f4e9b5f51a548dc9L206)




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to