File tree Expand file tree Collapse file tree 6 files changed +7
-13
lines changed Expand file tree Collapse file tree 6 files changed +7
-13
lines changed Original file line number Diff line number Diff line change 2
2
var cluster = require ( 'cluster' ) ;
3
3
var config = require ( './config' ) ;
4
4
var log = require ( './services/logger' ) ;
5
- var kue = require ( 'kue' ) ;
6
5
var basicAuth = require ( 'basic-auth-connect' ) ;
7
6
var express = require ( 'express' ) ;
8
7
9
8
if ( cluster . isMaster && config . env === 'production' ) {
9
+ var kue = require ( './services/queue' ) . kue ;
10
10
var app = express ( ) ;
11
11
app . use ( basicAuth ( config . queueUIUsername , config . queueUIPassword ) ) ;
12
12
app . use ( kue . app ) ;
Original file line number Diff line number Diff line change @@ -78,8 +78,7 @@ schemaObject.developer = {
78
78
79
79
schemaObject . tags = {
80
80
type : [ String ] ,
81
- index : 'text' ,
82
- default :[ ]
81
+ index : 'text'
83
82
} ;
84
83
85
84
// Let us define our schema
@@ -118,7 +117,6 @@ Schema.pre('save', function(next) {
118
117
119
118
// Dump it in the queue
120
119
queue . create ( 'searchIndex' , ourDoc )
121
- . priority ( 'high' )
122
120
. save ( ) ;
123
121
124
122
next ( ) ;
@@ -177,7 +175,6 @@ Schema.pre('update', function(next) {
177
175
} else {
178
176
// Dump it in the queue
179
177
queue . create ( 'searchIndex' , ourDoc )
180
- . priority ( 'high' )
181
178
. save ( ) ;
182
179
}
183
180
Original file line number Diff line number Diff line change @@ -91,7 +91,6 @@ Schema.pre('save', function(next) {
91
91
92
92
// Dump it in the queue
93
93
queue . create ( 'searchIndex' , ourDoc )
94
- . priority ( 'high' )
95
94
. save ( ) ;
96
95
97
96
next ( ) ;
@@ -147,7 +146,6 @@ Schema.pre('update', function(next) {
147
146
} else {
148
147
// Dump it in the queue
149
148
queue . create ( 'searchIndex' , ourDoc )
150
- . priority ( 'high' )
151
149
. save ( ) ;
152
150
}
153
151
Original file line number Diff line number Diff line change @@ -88,7 +88,6 @@ Schema.pre('save', function(next) {
88
88
89
89
// Dump it in the queue
90
90
queue . create ( 'searchIndex' , ourDoc )
91
- . priority ( 'high' )
92
91
. save ( ) ;
93
92
94
93
next ( ) ;
@@ -143,7 +142,6 @@ Schema.pre('update', function(next) {
143
142
} else {
144
143
// Dump it in the queue
145
144
queue . create ( 'searchIndex' , ourDoc )
146
- . priority ( 'high' )
147
145
. save ( ) ;
148
146
}
149
147
Original file line number Diff line number Diff line change 15
15
. on ( 'job complete' , function ( id , result ) {
16
16
kue . Job . get ( id , function ( err , job ) {
17
17
if ( err ) {
18
- throw new Error ( err . message ) ;
18
+ return false ;
19
19
} else {
20
20
job . remove ( function ( err ) {
21
21
if ( err ) {
@@ -55,3 +55,4 @@ queue.watchStuckJobs(1000);
55
55
56
56
// Process Jobs Here
57
57
module . exports = queue ;
58
+ module . exports . kue = kue ;
Original file line number Diff line number Diff line change @@ -36,9 +36,9 @@ jobs.updateRequestLog = function(response, done){
36
36
37
37
// Creates search tags for all db records
38
38
jobs . createSearchTags = function ( data , done ) {
39
- var model = data . model ;
40
- var update = data . update ? true : false ;
41
- if ( data . update ) {
39
+ var model = data . model ;
40
+ var update = data . update ? true : false ;
41
+ if ( data . update ) {
42
42
delete data . update ;
43
43
}
44
44
delete data . model ;
You can’t perform that action at this time.
0 commit comments