Fix for "Can't set headers after they are sent"

This commit is contained in:
Rafa de la Torre 2018-07-23 16:15:11 +02:00
parent 7b405cee5d
commit 8ec7e0e309

View File

@ -126,6 +126,8 @@ function handleCopyFrom (logger) {
.on('data', data => {
metrics.addSize(data.length);
if(metrics.size > dbRemainingQuota) {
metrics.end(null, err);
req.unpipe(pgstream);
return next(new Error('DB Quota exceeded'));
}
})