WIP - Semantic linking working asynchronously
This commit is contained in:
@@ -9,7 +9,7 @@ import { FieldDefinition } from '../models/field-definition.model';
|
||||
import { User } from '../models/user.model';
|
||||
import { ObjectMetadata } from './models/dynamic-model.factory';
|
||||
import { MeilisearchService } from '../search/meilisearch.service';
|
||||
import { SemanticOrchestratorService } from '../knowledge/services/semantic-orchestrator.service';
|
||||
import { SemanticRefreshQueueService } from '../knowledge/services/semantic-refresh-queue.service';
|
||||
|
||||
type SearchFilter = {
|
||||
field: string;
|
||||
@@ -40,7 +40,7 @@ export class ObjectService {
|
||||
private modelService: ModelService,
|
||||
private authService: AuthorizationService,
|
||||
private meilisearchService: MeilisearchService,
|
||||
private semanticOrchestratorService: SemanticOrchestratorService,
|
||||
private semanticRefreshQueue: SemanticRefreshQueueService,
|
||||
) {}
|
||||
|
||||
// Setup endpoints - Object metadata management
|
||||
@@ -1130,7 +1130,7 @@ export class ObjectService {
|
||||
);
|
||||
const record = await boundModel.query().insert(normalizedRecordData);
|
||||
await this.indexRecord(resolvedTenantId, objectApiName, objectDefModel.fields, record);
|
||||
await this.semanticOrchestratorService.refreshRecord(
|
||||
await this.semanticRefreshQueue.enqueue(
|
||||
resolvedTenantId,
|
||||
objectApiName,
|
||||
record.id,
|
||||
@@ -1206,7 +1206,7 @@ export class ObjectService {
|
||||
await boundModel.query().patch(normalizedEditableData).where({ id: recordId });
|
||||
const record = await boundModel.query().where({ id: recordId }).first();
|
||||
await this.indexRecord(resolvedTenantId, objectApiName, objectDefModel.fields, record);
|
||||
await this.semanticOrchestratorService.refreshRecord(
|
||||
await this.semanticRefreshQueue.enqueue(
|
||||
resolvedTenantId,
|
||||
objectApiName,
|
||||
recordId,
|
||||
|
||||
Reference in New Issue
Block a user