Basic mentions support (#832)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev
2022-01-19 10:04:30 +01:00
committed by GitHub
parent b56f3bba7c
commit 0d8daf2fea
96 changed files with 1006 additions and 1604 deletions
+1 -7
View File
@@ -39,8 +39,6 @@ import core, {
import { createElasticAdapter } from '@anticrm/elastic'
import { DOMAIN_ATTACHMENT } from '@anticrm/model-attachment'
import { createMongoAdapter, createMongoTxAdapter } from '@anticrm/mongo'
import { addLocation } from '@anticrm/platform'
import { serverChunterId } from '@anticrm/server-chunter'
import {
createServerStorage,
DbAdapter,
@@ -49,7 +47,6 @@ import {
IndexedDoc,
TxAdapter
} from '@anticrm/server-core'
import { serverRecruitId } from '@anticrm/server-recruit'
import { Client as ElasticClient } from '@elastic/elasticsearch'
import { Client } from 'minio'
import { Db, MongoClient } from 'mongodb'
@@ -102,8 +99,6 @@ export class ElasticTool {
storage!: ServerStorage
db!: Db
constructor (readonly mongoUrl: string, readonly dbName: string, readonly minio: Client, readonly elasticUrl: string) {
addLocation(serverChunterId, () => import('@anticrm/server-chunter-resources'))
addLocation(serverRecruitId, () => import('@anticrm/server-recruit-resources'))
this.mongoClient = new MongoClient(mongoUrl)
}
@@ -171,8 +166,7 @@ async function restoreElastic (mongoUrl: string, dbName: string, minio: Client,
const tool = new ElasticTool(mongoUrl, dbName, minio, elasticUrl)
const done = await tool.connect()
try {
const txes = (await tool.db.collection<Tx>(DOMAIN_TX).find().toArray())
const data = txes.filter((tx) => tx.objectSpace !== core.space.Model)
const data = (await tool.db.collection<Tx>(DOMAIN_TX).find().toArray())
const m = newMetrics()
const metricsCtx = new MeasureMetricsContext('elastic', {}, m)
console.log('replay elastic transactions', data.length)