Adapting Changelog and fixing Warn element

This commit is contained in:
Martin Karkowski 2021-10-15 17:04:32 +02:00
parent b2d3d19ad8
commit cfc26f627b
2 changed files with 11 additions and 2 deletions

View File

@ -1,3 +1,7 @@
# 0.9.7.2
- Add a parameter for the `runNopeBackend` to select the default service provider selection method.
# 0.9.7.1 # 0.9.7.1
- If the Channel "event" is selected the "force-emitting" is enabled - If the Channel "event" is selected the "force-emitting" is enabled

View File

@ -269,6 +269,8 @@ export class nopeDispatcher implements INopeDispatcher {
remove: number; remove: number;
}; };
private __warned: boolean;
/** /**
* Creates an instance of nopeDispatcher. * Creates an instance of nopeDispatcher.
* @param {nopeRpcDispatcherOptions} options The Options, used by the Dispatcher. * @param {nopeRpcDispatcherOptions} options The Options, used by the Dispatcher.
@ -303,6 +305,8 @@ export class nopeDispatcher implements INopeDispatcher {
}; };
} }
this.__warned = false;
if (RUNNINGINNODE) { if (RUNNINGINNODE) {
const os = require("os"); const os = require("os");
@ -2479,8 +2483,9 @@ export class nopeDispatcher implements INopeDispatcher {
let _func = func; let _func = func;
if (!isAsyncFunction(func)) { if (!this.__warned && !isAsyncFunction(func)) {
throw Error("Only Async Functions are allowed"); this._logger.warn("!!! You have provided synchronous functions. They may break NoPE. Use them with care !!!");
this.__warned = true;
} }
if (options.deleteAfterCalling) { if (options.deleteAfterCalling) {