We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c2b05e3 commit 746d73aCopy full SHA for 746d73a
packages/open-next/src/adapters/server-adapter.ts
@@ -35,6 +35,12 @@ declare global {
35
36
const CACHE_BUCKET_REGION = process.env.CACHE_BUCKET_REGION;
37
38
+// Cache clients using global variables
39
+// Note: The clients are used in `cache.ts`. The incremental cache is recreated on
40
+// every request and required on every request (And the require cache is also
41
+// cleared). It was causing some file to stay open which after enough time
42
+// would cause the function to crash with error "EMFILE too many open". It
43
+// was also making the memory grow out of control.
44
globalThis.S3Client = new S3Client({
45
region: CACHE_BUCKET_REGION,
46
logger: awsLogger,
0 commit comments