Permalink
Browse files

refactored previous commit

  • Loading branch information...
1 parent e910aea commit 3813985a3ebd5d8c23be8833417ad2dce1868c25 @tj tj committed Aug 10, 2011
Showing with 6 additions and 11 deletions.
  1. +3 −6 lib/http/routes/json.js
  2. +3 −5 lib/queue/job.js
View
@@ -20,14 +20,11 @@ var Queue = require('../../kue')
var search;
function getSearch() {
- if (!search) {
- reds.createClient = require('../../redis').createClient;
- search = reds.createSearch('q:search');
- }
- return search;
+ if (search) return search;
+ reds.createClient = require('../../redis').createClient;
+ return search = reds.createSearch('q:search');
};
-
/**
* Get statistics including:
*
View
@@ -27,11 +27,9 @@ exports = module.exports = Job;
var search;
function getSearch() {
- if (!search) {
- reds.createClient = require('../redis').createClient;
- search = reds.createSearch('q:search');
- }
- return search;
+ if (search) return search;
+ reds.createClient = require('../redis').createClient;
+ return search = reds.createSearch('q:search');
};
/**

0 comments on commit 3813985

Please sign in to comment.