diff --git a/package-lock.json b/package-lock.json index 4e09cebdcc..ab397a0dea 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "alkemio-server", - "version": "0.79.0", + "version": "0.79.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "alkemio-server", - "version": "0.79.0", + "version": "0.79.1", "license": "EUPL-1.2", "dependencies": { "@alkemio/matrix-adapter-lib": "^0.3.6", diff --git a/package.json b/package.json index 38be833b62..fba8cbbeed 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "alkemio-server", - "version": "0.79.0", + "version": "0.79.1", "description": "Alkemio server, responsible for managing the shared Alkemio platform", "author": "Alkemio Foundation", "private": false, diff --git a/src/services/api/search/v2/ingest/search.ingest.service.ts b/src/services/api/search/v2/ingest/search.ingest.service.ts index 059a8e2c56..25a0681a37 100644 --- a/src/services/api/search/v2/ingest/search.ingest.service.ts +++ b/src/services/api/search/v2/ingest/search.ingest.service.ts @@ -860,14 +860,14 @@ export class SearchIngestService { take: limit, }) .then(spaces => { - const spaceLevel0Posts: any[] = []; + const posts: any[] = []; spaces.forEach(space => space?.collaboration?.callouts?.forEach(callout => callout?.contributions?.forEach(contribution => { if (!contribution.post) { return; } - spaceLevel0Posts.push({ + posts.push({ ...contribution.post, type: SearchEntityTypes.POST, license: { @@ -886,69 +886,8 @@ export class SearchIngestService { }) ) ); - const spaceLevel1Posts: any[] = []; - spaces.forEach(space => - space?.subspaces?.forEach(subspace => - subspace?.collaboration?.callouts?.forEach(callout => - callout?.contributions?.forEach(contribution => { - if (!contribution.post) { - return; - } - spaceLevel1Posts.push({ - ...contribution.post, - type: SearchEntityTypes.POST, - license: { - visibility: - space?.account?.license?.visibility ?? EMPTY_VALUE, - }, - spaceID: space.id, - challengeID: subspace.id, - calloutID: callout.id, - collaborationID: space?.collaboration?.id ?? EMPTY_VALUE, - profile: { - ...contribution.post.profile, - tagsets: undefined, - tags: processTagsets(contribution.post?.profile?.tagsets), - }, - }); - }) - ) - ) - ); - const spaceLevel2Posts: any[] = []; - spaces.forEach(space => - space?.subspaces?.forEach(subspace => - subspace?.subspaces?.forEach(subsubspace => - subsubspace?.collaboration?.callouts?.forEach(callout => - callout?.contributions?.forEach(contribution => { - if (!contribution.post) { - return; - } - spaceLevel2Posts.push({ - ...contribution.post, - type: SearchEntityTypes.POST, - license: { - visibility: - space?.account?.license?.visibility ?? EMPTY_VALUE, - }, - spaceID: space.id, - challengeID: subspace.id, - opportunityID: subsubspace.id, - calloutID: callout.id, - collaborationID: space?.collaboration?.id ?? EMPTY_VALUE, - profile: { - ...contribution.post.profile, - tagsets: undefined, - tags: processTagsets(contribution.post?.profile?.tagsets), - }, - }); - }) - ) - ) - ) - ); - return [...spaceLevel0Posts, ...spaceLevel1Posts, ...spaceLevel2Posts]; + return posts; }); } } diff --git a/src/services/task/task.service.ts b/src/services/task/task.service.ts index f47a6f7f2c..1a7ac9d480 100644 --- a/src/services/task/task.service.ts +++ b/src/services/task/task.service.ts @@ -143,6 +143,7 @@ export class TaskService { const task = await this.getOrFail(id); task.status = status; + task.end = new Date().getTime(); await this.cacheManager.set(task.id, task, { ttl: TTL,