node-proper-lockfile
node-proper-lockfile copied to clipboard
feat: add strict mode
Ref: #81
Strict mode is currently only used for toggling compromised lock behaviour
Codecov Report
Merging #86 into master will increase coverage by
1.70%. The diff coverage is100.00%.
@@ Coverage Diff @@
## master #86 +/- ##
===========================================
+ Coverage 98.29% 100.00% +1.70%
===========================================
Files 4 6 +2
Lines 176 205 +29
Branches 45 50 +5
===========================================
+ Hits 173 205 +32
+ Misses 3 0 -3
| Impacted Files | Coverage Δ | |
|---|---|---|
| lib/lockfile.js | 100.00% <100.00%> (+2.45%) |
:arrow_up: |
| test/util/wait.js | 100.00% <100.00%> (ø) |
|
| lib/mtime-precision.js | 100.00% <0.00%> (ø) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update 1a478a4...c19d934. Read the comment docs.
@pimlie I would prefer to not add any option and actually make this the default. This means that the PR would be much simpler by just changing this to not throw: https://github.com/moxystudio/node-proper-lockfile/blob/c0cdea2e86ea28acff66ac1194fc45debfee0d87/lib/lockfile.js#L240
@satazor What about still removing the lock when its compromised? I guess you are opposed to that?
The reason I added it because I actually like the idea that both processes will generate a warning untill we figured out why the lock was compromised in the first place.
If the lock has been compromised, it usually means that someone else got the lock. It would be bad to delete the lock in that situation.
Updated as requested :)