|
@@ -1,6 +1,7 @@
|
|
|
const OError = require('@overleaf/o-error')
|
|
const OError = require('@overleaf/o-error')
|
|
|
const express = require('express')
|
|
const express = require('express')
|
|
|
const bodyParser = require('body-parser')
|
|
const bodyParser = require('body-parser')
|
|
|
|
|
+const http = require('http')
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* Abstract class for running a mock API via Express. Handles setting up of
|
|
* Abstract class for running a mock API via Express. Handles setting up of
|
|
@@ -139,7 +140,14 @@ class AbstractMockApi {
|
|
|
// eslint-disable-next-line no-console
|
|
// eslint-disable-next-line no-console
|
|
|
console.log('Starting mock on port', this.constructor.name, this.port)
|
|
console.log('Starting mock on port', this.constructor.name, this.port)
|
|
|
}
|
|
}
|
|
|
- this.server = this.app
|
|
|
|
|
|
|
+ this.server = http
|
|
|
|
|
+ .createServer(
|
|
|
|
|
+ {
|
|
|
|
|
+ // Workaround broken detection of idle connections in CI.
|
|
|
|
|
+ connectionsCheckingInterval: 30 * 60 * 1000,
|
|
|
|
|
+ },
|
|
|
|
|
+ this.app
|
|
|
|
|
+ )
|
|
|
.listen(this.port, err => {
|
|
.listen(this.port, err => {
|
|
|
if (err) {
|
|
if (err) {
|
|
|
return reject(err)
|
|
return reject(err)
|