Show a message if cloud functions are duplicated (#6963)
* Update triggers.js * Update CloudCode.spec.js * Logger changes * Update CloudCode.spec.js
This commit is contained in:
@@ -98,6 +98,11 @@ function getStore(category, name, applicationId) {
|
||||
function add(category, name, handler, applicationId) {
|
||||
const lastComponent = name.split('.').splice(-1);
|
||||
const store = getStore(category, name, applicationId);
|
||||
if (store[lastComponent]) {
|
||||
logger.warn(
|
||||
`Warning: Duplicate cloud functions exist for ${lastComponent}. Only the last one will be used and the others will be ignored.`
|
||||
);
|
||||
}
|
||||
store[lastComponent] = handler;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user