Skip to content

Commit

Permalink
fix broker option name prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
icebob committed May 3, 2018
1 parent fb1dffa commit ad9cb20
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/service-broker.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const defaultOptions = {
heartbeatTimeout: 15,

trackContext: false,
$gracefulStopTimeout: 2000,
gracefulStopTimeout: 2000,

disableBalancer: false,

Expand Down
2 changes: 1 addition & 1 deletion src/service.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ class Service {

this.stopped = () => {
return new this.Promise((resolve, reject) => {
const timeout = setTimeout(reject, this.settings.$gracefulStopTimeout || this.broker.options.$gracefulStopTimeout);
const timeout = setTimeout(reject, this.settings.$gracefulStopTimeout || this.broker.options.gracefulStopTimeout);
const checkForContexts = () => {
if (this._getActiveContexts().length === 0) {
clearTimeout(timeout);
Expand Down
6 changes: 3 additions & 3 deletions test/integration/service.lifecycle.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
let ServiceBroker = require("../../src/service-broker");
const ServiceBroker = require("../../src/service-broker");
const { protectReject } = require("../unit/utils");

describe("Test Service handlers", () => {

Expand Down Expand Up @@ -107,7 +108,6 @@ describe("Test Service handlerswith delayed shutdown", () => {
const service = broker.createService(schema);
service.schema.actions.test.mockResolvedValue(service.Promise.delay(80));
const getActiveContextsSpy = jest.spyOn(service, "_getActiveContexts");
// const trackContextsSpy = jest.spyOn(service, "_trackContext");
return broker.start()
.then(() => {
broker.call("delayed.test", {});
Expand All @@ -120,6 +120,6 @@ describe("Test Service handlerswith delayed shutdown", () => {

getActiveContextsSpy.mockReset();
getActiveContextsSpy.mockRestore();
});
}).catch(protectReject);
});
});
2 changes: 1 addition & 1 deletion test/unit/service-broker.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ describe("Test ServiceBroker constructor", () => {
heartbeatTimeout : 20,
heartbeatInterval: 5,
trackContext: false,
$gracefulStopTimeout: 2000,
gracefulStopTimeout: 2000,

disableBalancer: true,
registry: {
Expand Down

0 comments on commit ad9cb20

Please sign in to comment.