Closed nicolaifsf closed 7 years ago
Hi @nicolaifsf, you are partially correct. The process hangs on, but the connection is closed. Our wrapper caches the results in the RAM, thanks to memory-cache, which by default keeps alive the process.
I tried building this wrapper without memory-cache and it correctly quits.
Maybe we could implement something that, if the cacheLimit is zero, doesn't invoke memory-cache so the process quits normally.
Got it! If you set for example a cacheLimit of 3 seconds. The wrapper will maintain the cache only for 3 seconds and then exits.
var options = {
protocol: 'http',
hostName: 'pokeapi.co',
versionPath: '/api/v2/',
timeout: 10000,
cacheLimit: 3 * 1000
}
That solved problem! Thank you so much! 👍
Function calls do not end after a request is made.
When using the example, calling P.getPokemonByName() and logging to console works, however it hangs after that.