rename methods
gitea/mylogger/pipeline/pr-master This commit looks good
Details
gitea/mylogger/pipeline/pr-master This commit looks good
Details
This commit is contained in:
parent
bd48afa684
commit
b53b03b81c
|
@ -19,9 +19,9 @@ module.exports = class Salix {
|
|||
this._salixVersion = null;
|
||||
this._salixConfig = null;
|
||||
}
|
||||
fooListener(val) {}
|
||||
registerNewListener(externalListenerFunction) {
|
||||
this.fooListener = externalListenerFunction;
|
||||
emit() {}
|
||||
subscribe(externalListenerFunction) {
|
||||
this.emit = externalListenerFunction;
|
||||
}
|
||||
async init(logger) {
|
||||
this.conf = logger.conf;
|
||||
|
@ -180,7 +180,7 @@ module.exports = class Salix {
|
|||
return this._salixVersion;
|
||||
}
|
||||
set salixVersion(newVersion) {
|
||||
if(this._salixVersion) this.fooListener(newVersion);
|
||||
if(this._salixVersion && (this._salixVersion!== newVersion)) this.emit(newVersion);
|
||||
|
||||
this._salixVersion = newVersion;
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ module.exports = class MyLogger {
|
|||
async start() {
|
||||
const conf = (this.conf = loadConfig(__dirname, 'config'));
|
||||
const salix = new Salix();
|
||||
salix.registerNewListener(() => {
|
||||
salix.subscribe(( ) => {
|
||||
this.stop();
|
||||
this.start();
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue