Skip to content

Commit 746d73a

Browse files
committed
Update comments
1 parent c2b05e3 commit 746d73a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/open-next/src/adapters/server-adapter.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ declare global {
3535

3636
const CACHE_BUCKET_REGION = process.env.CACHE_BUCKET_REGION;
3737

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.
3844
globalThis.S3Client = new S3Client({
3945
region: CACHE_BUCKET_REGION,
4046
logger: awsLogger,

0 commit comments

Comments
 (0)