Hook redis init flow into overall worker init flow.
This commit is contained in:
parent
dd2f68d099
commit
94983c289f
|
@ -37,6 +37,7 @@ export { SearchParams } from "./db"
|
|||
// circular dependencies
|
||||
import * as context from "./context"
|
||||
import * as _tenancy from "./tenancy"
|
||||
import * as redis from "./redis"
|
||||
export const tenancy = {
|
||||
..._tenancy,
|
||||
...context,
|
||||
|
@ -50,6 +51,8 @@ export * from "./constants"
|
|||
|
||||
// expose package init function
|
||||
import * as db from "./db"
|
||||
export const init = (opts: any = {}) => {
|
||||
|
||||
export const init = async (opts: any = {}) => {
|
||||
db.init(opts.db)
|
||||
await redis.init()
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ export { default as Client } from "./redis"
|
|||
export * as utils from "./utils"
|
||||
export * as clients from "./init"
|
||||
export * as locks from "./redlockImpl"
|
||||
export * from "./init"
|
||||
|
||||
export * from "./invite"
|
||||
export * from "./passwordReset"
|
||||
|
|
|
@ -11,7 +11,7 @@ let userClient: Client,
|
|||
inviteClient: Client,
|
||||
passwordResetClient: Client
|
||||
|
||||
async function init() {
|
||||
export async function init() {
|
||||
userClient = await new Client(utils.Databases.USER_CACHE).init()
|
||||
sessionClient = await new Client(utils.Databases.SESSIONS).init()
|
||||
appClient = await new Client(utils.Databases.APP_METADATA).init()
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import * as core from "@budibase/backend-core"
|
||||
import env from "../environment"
|
||||
|
||||
export function init() {
|
||||
export async function init() {
|
||||
const dbConfig: any = {
|
||||
replication: true,
|
||||
find: true,
|
||||
|
@ -12,5 +12,5 @@ export function init() {
|
|||
dbConfig.allDbs = true
|
||||
}
|
||||
|
||||
core.init({ db: dbConfig })
|
||||
await core.init({ db: dbConfig })
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue