[core] Make it possible to limit the size of the SQLite cache

This commit is contained in:
Thiago Marcos P. Santos
2015-12-14 11:16:01 -08:00
parent 225eda4fff
commit 6d0b01c5fb
4 changed files with 269 additions and 37 deletions

View File

@@ -107,6 +107,9 @@ int main(int argc, char *argv[]) {
view = std::make_unique<GLFWView>(fullscreen, benchmark);
mbgl::SQLiteCache cache("/tmp/mbgl-cache.db");
cache.setMaximumCacheEntrySize(1 * 1024 * 1024); // 1 MB
cache.setMaximumCacheSize(50 * 1024 * 1024); // 50 MB
mbgl::DefaultFileSource fileSource(&cache);
// Set access token if present