Permalink
Browse files

Issue #19296 Make extra pgWorker option is accessible.

  • Loading branch information...
1 parent 23a3f30 commit 928d05b6d4d52d2c8d03f4912e01c8e5a30923c2 @bendiy committed Apr 1, 2013
Showing with 2 additions and 2 deletions.
  1. +2 −2 node-datasource/lib/ext/datasource.js
@@ -21,7 +21,7 @@ white:true*/
X.addCleanupTask(_.bind(this.cleanup, this), this);
X.pg.defaults.poolSize = this.poolSize;
- if (X.options.datasource.pgWorker) {
+ if (X.options && X.options.datasource && X.options.datasource.pgWorker) {
// Single worker version.
this.worker = require('child_process').fork(__dirname + '/pgworker.js');
this.worker.on('message', function (m) {
@@ -80,7 +80,7 @@ white:true*/
query: function (query, options, callback) {
var str = this.conString(_.clone(options));
- if (X.options.datasource.pgWorker) {
+ if (X.options && X.options.datasource && X.options.datasource.pgWorker) {
this.requestNum += 1;
this.callbacks[this.requestNum] = callback;

0 comments on commit 928d05b

Please sign in to comment.