1
0
Fork 0
mirror of synced 2024-06-14 00:14:39 +12:00

Some fixes based on PR comments.

This commit is contained in:
mike12345567 2022-10-24 12:06:50 +01:00
parent 147799ba0a
commit e31ce3f8a9
3 changed files with 11 additions and 16 deletions

View file

@ -4,7 +4,7 @@ import { JobQueue } from "./constants"
import InMemoryQueue from "./inMemoryQueue"
import BullQueue from "bull"
import { addListeners, StalledFn } from "./listeners"
const { opts, redisProtocolUrl } = getRedisOptions()
const { opts: redisOpts, redisProtocolUrl } = getRedisOptions()
const CLEANUP_PERIOD_MS = 60 * 1000
let QUEUES: BullQueue.Queue[] | InMemoryQueue[] = []
@ -18,9 +18,9 @@ async function cleanup() {
export function createQueue<T>(
jobQueue: JobQueue,
opts: { removeStalledCb?: StalledFn }
opts: { removeStalledCb?: StalledFn } = {}
): BullQueue.Queue<T> {
const queueConfig: any = redisProtocolUrl || { redis: opts }
const queueConfig: any = redisProtocolUrl || { redis: redisOpts }
let queue: any
if (!env.isTest()) {
queue = new BullQueue(jobQueue, queueConfig)

View file

@ -1,4 +1,3 @@
export * from "./documents"
export * from "./sdk"
export * from "./api"
export * from "./core"

View file

@ -1,4 +1,4 @@
import { Context } from "koa"
import { Context, Request } from "koa"
import { User } from "../documents"
import { License } from "../sdk"
@ -7,15 +7,11 @@ export interface ContextUser extends User {
license: License
}
export interface BBContext {
user?: ContextUser
status?: number
request: {
body: any
}
params: any
body?: any
redirect?: any
attachment: any
throw: any
export interface BBRequest extends Request {
body: any
}
export interface BBContext extends Context {
request: BBRequest
user?: ContextUser
}