danielstjules / redislock

Node distributed locking using redis
MIT License
110 stars 32 forks source link

Nodeify early returns to get consistency #2

Closed codingpains closed 9 years ago

codingpains commented 9 years ago

Since we added this package to our solo worker library we noticed that when we sent a callback to handle errors, some promise rejections remained unhandled and our server logs where full of red with the same error.

This commit gives more consistency because we expect to handle all errors in the callback instead of getting some in the callback and some returned in a rejected promise.

Thanks!

danielstjules commented 9 years ago

Sorry about that! Issue was probably introduced in one of the more recent refactors. The callback based API could probably use a few more tests. Thank you!

codingpains commented 9 years ago

No problem, your library has been making our lives at VoxFeed a lot easier.

Gus Ortiz

On Fri, Aug 28, 2015 at 10:23 AM, Daniel St. Jules <notifications@github.com

wrote:

Sorry about that! Issue was probably introduced in one of the more recent refactors. The callback based API could probably use a few more tests. Thank you!

— Reply to this email directly or view it on GitHub https://github.com/danielstjules/redislock/pull/2#issuecomment-135805077 .

danielstjules commented 9 years ago

Thanks! I updated the specs to include a bunch of tests for the callback-based API: https://github.com/danielstjules/redislock/blob/master/spec/lockSpec.js Should prevent any regressions. I've tagged a new release as well. Glad it's helpful :)