Be more one liner
This commit is contained in:
parent
9c8d802f75
commit
8eab164e4e
@ -19,12 +19,8 @@ module.exports = class StreamCopy {
|
||||
const pgstream = client.query(copyToStream);
|
||||
|
||||
pgstream
|
||||
.on('error', err => {
|
||||
done(err);
|
||||
})
|
||||
.on('end', () => {
|
||||
done();
|
||||
});
|
||||
.on('end', () => done())
|
||||
.on('error', err => done(err));
|
||||
|
||||
cb(null, pgstream, copyToStream, client, done);
|
||||
});
|
||||
@ -40,12 +36,8 @@ module.exports = class StreamCopy {
|
||||
const pgstream = client.query(copyFromStream);
|
||||
|
||||
pgstream
|
||||
.on('error', err => {
|
||||
done(err);
|
||||
})
|
||||
.on('end', () => {
|
||||
done();
|
||||
});
|
||||
.on('end', () => done())
|
||||
.on('error', err => done(err));
|
||||
|
||||
cb(null, pgstream, copyFromStream, client, done);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user