curveball / core

The Curveball framework is a TypeScript framework for node.js with support for modern HTTP features.
https://curveballjs.org/
MIT License
525 stars 7 forks source link

Process remains running after server close #160

Open simov opened 3 years ago

simov commented 3 years ago

Any idea why after server.close the process remains running?

The session middleware seems to be the cause:

app.use(session({store: 'memory'}))

Ok, it's the scheduleGc https://github.com/curveball/session/blob/master/src/memorystore.ts#L97 ...

evert commented 3 years ago

Yes... any further thoughts about this? I don't know if this is easily fixable, but I suppose we could add a function to stop the interval.

simov commented 3 years ago

Definitely opting out will be awesome. Right now I'm monkey-patching setTimeout so that I can close it on server close ..