Fix for "Can't set headers after they are sent"
This commit is contained in:
parent
7b405cee5d
commit
8ec7e0e309
@ -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'));
|
||||
}
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user