tonysun83 commented on a change in pull request #1432: Support callback module
data provider
URL: https://github.com/apache/couchdb/pull/1432#discussion_r201868529
##########
File path: src/couch_epi/src/couch_epi_data.erl
##########
@@ -102,12 +102,15 @@ definitions({file, FilePath}) ->
{error, Reason} ->
{error, {FilePath, Reason}}
end;
-definitions({module, Module}) when is_atom(Module) ->
- definitions({module, [Module]});
-definitions({module, Modules}) ->
+definitions({static_module, Module}) when is_atom(Module) ->
+ definitions({static_module, [Module]});
+definitions({static_module, Modules}) ->
Data = lists:append([M:data() || M <- Modules]),
Hash = couch_epi_functions_gen:hash(Modules),
- {ok, Hash, Data}.
+ {ok, Hash, Data};
+definitions({callback_module, Module}) ->
+ Data = Module:data(),
Review comment:
It seems we are separating two different module types, but I'm not sure
where we are actually regenerating the module. I still have to manually call
```couch_epi_data_gen:generate/3``` to get values for new keys.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services