Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Q
query-service
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GraphPolaris
Microservices
query-service
Commits
90263c2f
Commit
90263c2f
authored
1 week ago
by
Marcos Pieras
Browse files
Options
Downloads
Patches
Plain Diff
test: wip
parent
c0f20bd2
No related branches found
Branches containing commit
Tags
v1.18.1
Tags containing commit
1 merge request
!42
test: adds return message to handle e2e tests
Pipeline
#147220
passed
1 week ago
Stage: tag-release
Stage: get-release-tag
Stage: container-image
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/index.ts
+1
-1
1 addition, 1 deletion
src/index.ts
src/readers/insightProcessor.ts
+16
-2
16 additions, 2 deletions
src/readers/insightProcessor.ts
with
17 additions
and
3 deletions
src/index.ts
+
1
−
1
View file @
90263c2f
...
...
@@ -24,7 +24,7 @@ async function main() {
log
.
info
(
'
Connected to Redis!
'
);
await
queryServiceReader
(
frontendPublisher
,
mlPublisher
,
'
neo4j
'
);
await
insightProcessor
();
await
insightProcessor
(
frontendPublisher
);
}
await
main
();
This diff is collapsed.
Click to expand it.
src/readers/insightProcessor.ts
+
16
−
2
View file @
90263c2f
import
{
rabbitMq
,
ums
,
mail
,
SMTP_USER
,
DEBUG_EMAIL
}
from
'
../variables
'
;
import
{
rabbitMq
,
ums
,
mail
,
SMTP_USER
,
DEBUG_EMAIL
,
ENV
}
from
'
../variables
'
;
import
{
log
}
from
'
../logger
'
;
import
{
type
InsightModel
}
from
'
ts-common
'
;
import
{
createHeadlessEditor
}
from
'
@lexical/headless
'
;
...
...
@@ -14,6 +14,7 @@ import { populateTemplate } from '../utils/insights';
import
{
RabbitMqBroker
}
from
'
ts-common/rabbitMq
'
;
import
{
validateInsight
}
from
'
../utils/insights/validateInsight
'
;
import
{
validateTypeInsight
}
from
'
../utils/insights/validateTypeInsight
'
;
import
{
wsReturnKey
,
type
WsMessageBackend2Frontend
}
from
'
ts-common
'
;
const
dom
=
new
JSDOM
();
function
setUpDom
()
{
...
...
@@ -36,7 +37,7 @@ function setUpDom() {
};
}
export
const
insightProcessor
=
async
()
=>
{
export
const
insightProcessor
=
async
(
frontendPublisher
:
RabbitMqBroker
)
=>
{
if
(
mail
==
null
)
{
log
.
warn
(
'
Mail is not configured. Insight processor will be disabled
'
);
//return;
...
...
@@ -101,8 +102,21 @@ export const insightProcessor = async () => {
insight
=
statCheck
(
insight
,
result
);
}
log
.
info
(
'
Insight save:
'
,
insight
);
await
ums
.
updateInsight
(
insight
.
userId
as
number
,
insight
.
id
,
insight
);
if
(
ENV
==
'
develop
'
)
{
const
message
:
WsMessageBackend2Frontend
=
{
type
:
wsReturnKey
.
insightResults
,
callID
:
headers
.
callID
,
insight
,
status
:
'
success
'
,
};
frontendPublisher
.
publishMessageToFrontend
(
message
,
headers
.
routingKey
,
headers
);
}
if
(
insight
.
status
||
message
.
force
)
{
if
(
insight
.
status
)
log
.
debug
(
'
Insight passed the check
'
);
if
(
message
.
force
)
log
.
debug
(
'
Forced insight processing
'
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment