node-proper-lockfile icon indicating copy to clipboard operation
node-proper-lockfile copied to clipboard

feat: add strict mode

Open pimlie opened this issue 6 years ago • 5 comments

Ref: #81

Strict mode is currently only used for toggling compromised lock behaviour

pimlie avatar Mar 30 '19 12:03 pimlie

Codecov Report

Merging #86 into master will increase coverage by 1.70%. The diff coverage is 100.00%.

Impacted file tree graph

@@             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 data Powered by Codecov. Last update 1a478a4...c19d934. Read the comment docs.

codecov[bot] avatar Mar 30 '19 12:03 codecov[bot]

@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 avatar Apr 03 '19 12:04 satazor

@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.

pimlie avatar Apr 03 '19 12:04 pimlie

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.

satazor avatar Apr 03 '19 12:04 satazor

Updated as requested :)

pimlie avatar Apr 03 '19 12:04 pimlie