Skip to content

Commit

Permalink
use domaine instead of domain
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien Gilli committed Feb 23, 2019
1 parent 5051f41 commit a6503ed
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lib/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

'use strict';

var domain = require('domain');
var domaine = require('domaine');
var EventEmitter = require('events').EventEmitter;
var http = require('http');
var https = require('https');
Expand Down Expand Up @@ -823,7 +823,7 @@ Server.prototype._onRequest = function _onRequest(req, res) {
// It has significant negative performance impact
// Warning: this feature depends on the deprecated domains module
if (self.handleUncaughtExceptions) {
var handlerDomain = domain.create();
var handlerDomain = domaine.create();
handlerDomain.add(req);
handlerDomain.add(res);
handlerDomain.on('error', function onError(err) {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
"assert-plus": "^1.0.0",
"bunyan": "^1.8.12",
"csv": "^1.1.1",
"domaine": "git+https://github.com/misterdjules/domaine.git#alternative-approach",
"escape-regexp-component": "^1.0.2",
"ewma": "^2.0.1",
"find-my-way": "^2.0.1",
Expand Down
9 changes: 5 additions & 4 deletions test/lib/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
'use strict';
/* eslint-disable func-names */

var domain = require('domain');
var domaine = require('domaine');

var bunyan = require('bunyan');
var once = require('once');
Expand All @@ -19,7 +19,7 @@ var restify = require('../../lib');
module.exports = {
after: function after(teardown) {
module.parent.exports.tearDown = function _teardown(callback) {
var d = domain.create();
var d = domaine.create();
var self = this;

d.once('error', function(err) {
Expand All @@ -35,7 +35,7 @@ module.exports = {

before: function before(setup) {
module.parent.exports.setUp = function _setup(callback) {
var d = domain.create();
var d = domaine.create();
var self = this;

d.once('error', function(err) {
Expand All @@ -51,7 +51,7 @@ module.exports = {

test: function test(name, tester) {
module.parent.exports[name] = function _(t) {
var d = domain.create();
var d = domaine.create();
var self = this;

d.once('error', function(err) {
Expand All @@ -60,6 +60,7 @@ module.exports = {
});

d.add(t);

d.run(function() {
t.end = once(function() {
t.done();
Expand Down

0 comments on commit a6503ed

Please # to comment.