node-proper-lockfile
node-proper-lockfile copied to clipboard
fix: consider locks acquired in the future to be stale
We're sometimes running into a situation where a hard system restart causes the system time to jump backwards. This causes locks to remain with an mtime in the future, unable to lock them.
This PR considers the stale interval in both directions. Any lock that is stale milliseconds older or newer than now() will be considered stale.