Skip to content

[bug][regression] mysql2.setMaxParserCache fails with TypeError #2752

@constb

Description

@constb

Hi!

If I call setMaxParserCache imported from mysql2, I get an error:

<snip>/node_modules/mysql2/lib/parsers/parser_cache.js:54
  parserCache.max = max;
                  ^
TypeError: Cannot set property max of #<LRUCache> which has only a getter

I really need to downsize this cache because it always ends up being full and consuming about 300Mb RAM. Probably something about my use case that makes it grow so big…

I believe somewhere along the way lru-cache changed its internals and cannot be resized anymore. I'd like if setMaxParserCache would throw away an old cache and create a new one with right size in its place…

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions