i18next / i18next-http-backend

i18next-http-backend is a backend layer for i18next using in Node.js, in the browser and for Deno.
MIT License
452 stars 70 forks source link

Dereference timers in node.js so that the process may exit when finished #139

Closed danthegoodman closed 6 months ago

danthegoodman commented 6 months ago

Using the package in a node script is preventing the process from exiting because the reload interval timer has not been marked with unref. This PR resolves that issue.

For testing, I removed the --exit flag that had been previously been forcing mocha to exit immediately even if timers or servers were still open. This also required all servers and timers to in tests to be unrefed as well.

Checklist

danthegoodman commented 6 months ago

I didn't update the i18nextHttpBackend.js and ….min.js files because there were more changes in the files than just my targeted changes. I believe this is because the package-lock.json isn't in the repo, which means the babel/browserify packages have probably drifted slightly from the last run.

adrai commented 6 months ago

thank you, it's included in v2.5.2

danthegoodman commented 6 months ago

wow! So quick! Thank you 🎉