Skip to content

Commit

Permalink
fix: config loader
Browse files Browse the repository at this point in the history
  • Loading branch information
Elin Angelow committed May 9, 2024
1 parent e7aa055 commit 5b9f355
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ const layerProps = (layer, createConfig) => {
.join(' OR '),
'|'
);
if (Config(layerName) === 'false' || Config(namespace) === 'false') {
return false;
}
return {
layerName,
namespace,
Expand All @@ -36,7 +39,7 @@ module.exports = () => {
const api = {
create(component, {config: createConfig} = {}) {
const testConf = layerProps(component[component.length - 1], createConfig, Config);
if (testConf?.config.disabled === 'true') {
if (!testConf) {
return api;
}
const methodsList = new Map();
Expand Down
9 changes: 9 additions & 0 deletions lib/wss.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,15 @@ const Wss = ({
throw e;
}
}});
this.add({
name: this.namespace + '.close',
fn: async({params: connectionId}) => {
this.connections
.get(connectionId)
?.connection
?.close();
}
});
return super.init && await super.init();
}
requestAdd(connectionId, message) {
Expand Down

0 comments on commit 5b9f355

Please sign in to comment.