Skip to content
This repository has been archived by the owner on Sep 15, 2022. It is now read-only.

Must set maximumWeight for weigher in AssetServlet's Cache #41

Open
ash211 opened this issue Feb 24, 2016 · 2 comments
Open

Must set maximumWeight for weigher in AssetServlet's Cache #41

ash211 opened this issue Feb 24, 2016 · 2 comments

Comments

@ash211
Copy link

ash211 commented Feb 24, 2016

WARN [2016-02-23 00:12:08,697] com.google.common.cache.CacheBuilder: ignoring weigher specified without maximumWeight

I believe it's coming from

this.cache = CacheBuilder.from(spec).weigher(new AssetSizeWeigher()).build(loader);

@nbauernfeind
Copy link
Contributor

Yes you're correct. The cache spec either uses maximumSize or maximumWeight. If maximumWeight is specified we want to weigh objects by file size. If no weight is specified then it is limited by number of elements.

I've fixed this in: dropwizard-bundles/dropwizard-configurable-assets-bundle#17

I will do a 0.8.2 release and up.

@ash211
Copy link
Author

ash211 commented Feb 29, 2016

Looks like that'll cover it -- thanks @nbauernfeind !

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants