Improve chart performance (#7360)
* wip * wip * wip * wip * wip * Update chart.ts * wip * Improve server performance * wip * wip
This commit is contained in:
parent
0d19c2d42e
commit
4f249159d3
32 changed files with 889 additions and 161 deletions
18
src/queue/initialize.ts
Normal file
18
src/queue/initialize.ts
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
import * as Queue from 'bull';
|
||||
import config from '../config';
|
||||
|
||||
export function initialize(name: string, limitPerSec = -1) {
|
||||
return new Queue(name, {
|
||||
redis: {
|
||||
port: config.redis.port,
|
||||
host: config.redis.host,
|
||||
password: config.redis.pass,
|
||||
db: config.redis.db || 0,
|
||||
},
|
||||
prefix: config.redis.prefix ? `${config.redis.prefix}:queue` : 'queue',
|
||||
limiter: limitPerSec > 0 ? {
|
||||
max: limitPerSec * 5,
|
||||
duration: 5000
|
||||
} : undefined
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue