{"action":"opened","issue":{"url":"https://api.github.com/repos/hotelde/node-cache-manager-fs/issues/9","repository_url":"https://api.github.com/repos/hotelde/node-cache-manager-fs","labels_url":"https://api.github.com/repos/hotelde/node-cache-manager-fs/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/hotelde/node-cache-manager-fs/issues/9/comments","events_url":"https://api.github.com/repos/hotelde/node-cache-manager-fs/issues/9/events","html_url":"https://github.com/hotelde/node-cache-manager-fs/issues/9","id":160269417,"number":9,"title":"Does not refill cache on startup","user":{"login":"Jakobud","id":87356,"avatar_url":"https://avatars.githubusercontent.com/u/87356?v=3","gravatar_id":"","url":"https://api.github.com/users/Jakobud","html_url":"https://github.com/Jakobud","followers_url":"https://api.github.com/users/Jakobud/followers","following_url":"https://api.github.com/users/Jakobud/following{/other_user}","gists_url":"https://api.github.com/users/Jakobud/gists{/gist_id}","starred_url":"https://api.github.com/users/Jakobud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jakobud/subscriptions","organizations_url":"https://api.github.com/users/Jakobud/orgs","repos_url":"https://api.github.com/users/Jakobud/repos","events_url":"https://api.github.com/users/Jakobud/events{/privacy}","received_events_url":"https://api.github.com/users/Jakobud/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-06-14T19:55:22Z","updated_at":"2016-06-14T19:55:22Z","closed_at":null,"body":"No matter if I have `preventfill` true or false, every time I restart my script, the library does not fetch values from the existing cache on the filesystem. Here is some example code:\r\n\r\n```\r\nvar cacheManager = require('cache-manager');\r\nvar fsStore = require('cache-manager-fs');\r\nvar cache = cacheManager.caching({\r\n    store: fsStore, options: {\r\n      ttl: 60*60,\r\n      maxsize: 1000*1000*1000,\r\n      fillcallback: function(){\r\n        console.log('done filling from cache');\r\n      }\r\n    }\r\n  });\r\n\r\nvar ttl = 30;\r\n\r\nfunction getUser(id, cb) {\r\n    console.log(\"Returning user from slow database.\");\r\n    setTimeout(function () {\r\n        cb(null, {id: id, name: 'Bob'});\r\n    }, 5000);\r\n}\r\n\r\nvar userId = 123;\r\nvar key = 'user_' + userId;\r\n\r\ncache.wrap(key, function (cb) {\r\n    getUser(userId, cb);\r\n}, {ttl: ttl}, function (err, user) {\r\n    console.log(user);\r\n\r\n    cache.wrap(key, function (cb) {\r\n        getUser(userId, cb);\r\n    }, function (err, user) {\r\n        console.log(user);\r\n    });\r\n});\r\n```\r\n\r\nEvery time I run my script.js, the `getUser()` method is called (which takes 5 seconds). It never seems to repopulate the cache on startup.\r\n\r\nAm I missing something really obvious here?"}}
{"actor":{"display_login":"Jakobud"}}