File tree 1 file changed +5
-6
lines changed
1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change 1
1
const moment = require ( 'moment' ) ;
2
2
const _ = require ( 'lodash' ) ;
3
- const { default : PQueue } = require ( 'p-queue' ) ;
4
3
const StrategyContext = require ( '../../dict/strategy_context' ) ;
5
4
6
5
module . exports = class TickListener {
@@ -161,8 +160,6 @@ module.exports = class TickListener {
161
160
async startStrategyIntervals ( ) {
162
161
this . logger . info ( `Starting strategy intervals` ) ;
163
162
164
- const queue = new PQueue ( { concurrency : this . systemUtil . getConfig ( 'tick.pair_signal_concurrency' , 10 ) } ) ;
165
-
166
163
const me = this ;
167
164
168
165
const types = [
@@ -230,11 +227,13 @@ module.exports = class TickListener {
230
227
) ;
231
228
232
229
// first run call
233
- queue . add ( strategyIntervalCallback ) ;
230
+ setTimeout ( async ( ) => {
231
+ await strategyIntervalCallback ( ) ;
232
+ } , 1000 + Math . floor ( Math . random ( ) * ( 800 - 300 + 1 ) ) + 100 ) ;
234
233
235
234
// continuous run
236
- setInterval ( ( ) => {
237
- queue . add ( strategyIntervalCallback ) ;
235
+ setInterval ( async ( ) => {
236
+ await strategyIntervalCallback ( ) ;
238
237
} , interval ) ;
239
238
} , timeoutWindow ) ;
240
239
} ) ;
You can’t perform that action at this time.
0 commit comments