mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-09-13 14:18:57 +02:00
handle memory issues
This commit is contained in:
+11
-1
@@ -15,7 +15,17 @@ const logger = createLogger("streamer");
|
||||
const app = express();
|
||||
app.use(express.json());
|
||||
|
||||
app.use(compression());
|
||||
app.use(
|
||||
compression({
|
||||
filter: (req, res) => {
|
||||
// The streamer serves file blobs that are often binary (images,
|
||||
// archives) and can be very large. Compressing them holds zlib
|
||||
// buffers per response that pile up under concurrent load.
|
||||
if (req.path === "/api" && req.method === "POST") return false;
|
||||
return compression.filter(req, res);
|
||||
},
|
||||
})
|
||||
);
|
||||
|
||||
app.use("/api", router);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user