File tree 2 files changed +10
-7
lines changed
2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -27,16 +27,20 @@ var Poller = exports.Poller = function(config, swfClient) {
27
27
this . logger = config . logger || console ;
28
28
delete config . logger
29
29
this . taskLimitation = config . taskLimitation || Number . MAX_SAFE_INTEGER ;
30
+ delete config . taskLimitation
30
31
this . taskQueue = async . queue ( function ( queueFunc , callback ) {
31
- queueFunc ( callback ) ;
32
+ if ( ! self . pause_poller ) {
33
+ self . poll ( ) ;
34
+ }
35
+ queueFunc ( callback ) ;
32
36
} , this . taskLimitation ) ;
33
- this . taskQueue . drain = function ( ) {
34
- if ( this . pause_poller ) {
37
+ this . taskQueue . unsaturated = function ( ) {
38
+ if ( self . pause_poller ) {
35
39
self . resume ( ) ;
36
40
}
37
41
} ;
38
42
this . taskQueue . saturated = function ( ) {
39
- if ( ! this . pause_poller ) {
43
+ if ( ! self . pause_poller ) {
40
44
self . pause ( ) ;
41
45
}
42
46
} ;
@@ -117,7 +121,7 @@ Poller.prototype.stop = function () {
117
121
Poller . prototype . poll = function ( ) {
118
122
119
123
if ( this . stop_poller || this . pause_poller ) {
120
- this . logger . info ( 'Poller stopped, shutting down... ' ) ;
124
+ this . logger . info ( 'Poller stopped or paused ' ) ;
121
125
return ;
122
126
}
123
127
@@ -162,7 +166,6 @@ Poller.prototype.poll = function () {
162
166
return ;
163
167
}
164
168
_this . _onNewTask ( result ) ;
165
- _this . poll ( ) ;
166
169
} ) ;
167
170
168
171
} ;
Original file line number Diff line number Diff line change 21
21
"url" : " http://github.com/neyric/aws-swf.git"
22
22
},
23
23
"dependencies" : {
24
- "async" : " ^1.5.0 " ,
24
+ "async" : " ^2.1.2 " ,
25
25
"aws-sdk" : " ^2.2.22" ,
26
26
"lodash" : " ^3.10.1"
27
27
},
You can’t perform that action at this time.
0 commit comments