Skip to content

Commit

Permalink
Remove the need of log in src/index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
lygstate committed Aug 24, 2024
1 parent 89bd13d commit 1f9ddee
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
"@commitlint/cli": "^10.0.0",
"@commitlint/config-conventional": "^16.2.1",
"@icetee/ftp": "^1.0.2",
"bunyan": "^1.8.15",
"chai": "^4.2.0",
"condition-circle": "^2.0.2",
"eslint": "^5.14.1",
Expand Down
8 changes: 3 additions & 5 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
const _ = require('lodash');
const Promise = require('bluebird');
const nodeUrl = require('url');
const buyan = require('bunyan');
const net = require('net');
const tls = require('tls');
const EventEmitter = require('events');
Expand All @@ -13,7 +12,6 @@ class FtpServer extends EventEmitter {
constructor(options = {}) {
super();
this.options = Object.assign({
log: buyan.createLogger({name: 'ftp-srv'}),
url: 'ftp://127.0.0.1:21',
pasv_min: 1024,
pasv_max: 65535,
Expand Down Expand Up @@ -52,7 +50,7 @@ class FtpServer extends EventEmitter {
socket.once('close', () => {
this.emit('disconnect', {connection, id: connection.id, newConnectionCount: Object.keys(this.connections).length});
})

this.emit('connect', {connection, id: connection.id, newConnectionCount: Object.keys(this.connections).length});

const greeting = this._greeting || [];
Expand All @@ -67,7 +65,7 @@ class FtpServer extends EventEmitter {
this.log.error(err, '[Event] error');
this.emit('server-error', {error: err});
});

const quit = _.debounce(this.quit.bind(this), 100);

process.on('SIGTERM', quit);
Expand Down Expand Up @@ -138,7 +136,7 @@ class FtpServer extends EventEmitter {
} catch (err) {
this.log.error(err, 'Error closing connection', {id});
}

resolve('Disconnected');
});
}
Expand Down

0 comments on commit 1f9ddee

Please sign in to comment.