Closed nick-xero closed 2 years ago
This is not a bug but the expected behavior.
As the documentation says setGracefulCleanup()
is cleaning up the leftover temporary files on process exit. If the application does not exist and you are not cleaning up the files by calling the cleanUp()
function then the files won't be cleaned up.
Just think about it, from where would tmp
know that the files you created are still required or not. You should somehow signal it.
Operating System
NodeJS Version
v14.18.1
Tmp Version
0.2.1
Expected Behavior
As per the documentation, the library should automatically clean up tmp files; but if the process doesn't exit it does not clean up tmp files.
Calling http://localhost:3010 should create a tmp file and delete it after the callback is called, but the tmp file handle is kept on disk until the server is restarded. The workaround this is to call the cleanUp() callback.
Run
lsof | grep node | grep tmp | tail -10
to verify this.Experienced Behavior
TBD:What did actually happen?
Tmp files are cleaned up or documentation is changed.
This is probably related to #273. Let me know if you have any questions, happy to help.