diff --git a/searching-front/app/blitz-client.ts b/searching-front/app/blitz-client.ts index 3f9a872..826e6a2 100644 --- a/searching-front/app/blitz-client.ts +++ b/searching-front/app/blitz-client.ts @@ -2,10 +2,10 @@ import { AuthClientPlugin } from "@blitzjs/auth" import { setupBlitzClient } from "@blitzjs/next" import { BlitzRpcPlugin } from "@blitzjs/rpc" -export const authConfig = { - cookiePrefix: "searching-front-cookie-prefix", -} - +// export const authConfig = { +// cookiePrefix: "searching-front-cookie-prefix", +// } +//AuthClientPlugin(authConfig) export const { withBlitz } = setupBlitzClient({ - plugins: [AuthClientPlugin(authConfig), BlitzRpcPlugin({})], + plugins: [BlitzRpcPlugin({})], }) diff --git a/searching-front/services/modules/elastic/index.ts b/searching-front/services/modules/elastic/index.ts index 49abe0d..a2bda1d 100644 --- a/searching-front/services/modules/elastic/index.ts +++ b/searching-front/services/modules/elastic/index.ts @@ -89,13 +89,15 @@ class Elastic { } public initElastic = async () => { - ;[Languages.EN, Languages.RU].forEach(async (lang) => { + const promises = [Languages.EN, Languages.RU].map(async (lang) => { const indexName = getIndexNameByLang(lang) const alreadyExist = await this.client.indices.exists({ index: indexName }) if (!alreadyExist) { - await this.createIndex(lang) + return await this.createIndex(lang) } + return }) + return await Promise.all(promises) } public index = async (params: ElasticIndexParams) => {