Skip to main content
Homepage
Explore
Search or go to…
/
Register
Sign in
Explore
Primary navigation
Project
E
ems-esp-logger
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Collapse sidebar
Snippets
Groups
Projects
Show more breadcrumbs
Jonas Leder
ems-esp-logger
Commits
09304f9c
Commit
09304f9c
authored
9 months ago
by
Jonas Leder
Browse files
Options
Downloads
Patches
Plain Diff
use batch insert for values, to speedup SQL operation
parent
f1a9a8a9
Branches
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#54582
passed
9 months ago
Status:
Stage: build
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
messageworker/main.go
+3
-1
3 additions, 1 deletion
messageworker/main.go
with
3 additions
and
1 deletion
messageworker/main.go
+
3
−
1
View file @
09304f9c
...
@@ -42,6 +42,7 @@ func Run() {
...
@@ -42,6 +42,7 @@ func Run() {
queue
.
MainQueue
.
Enqueue
(
taskData
,
60
)
queue
.
MainQueue
.
Enqueue
(
taskData
,
60
)
return
return
}
}
valuesToInsert
:=
[]
tables
.
Value
{}
for
key
,
value
:=
range
jsonData
{
for
key
,
value
:=
range
jsonData
{
valueType
:=
database
.
GetOrCreateValueType
(
key
)
valueType
:=
database
.
GetOrCreateValueType
(
key
)
dbValue
:=
tables
.
Value
{
dbValue
:=
tables
.
Value
{
...
@@ -50,8 +51,9 @@ func Run() {
...
@@ -50,8 +51,9 @@ func Run() {
Value
:
helper
.
AnyToString
(
value
),
Value
:
helper
.
AnyToString
(
value
),
Instance
:
instance
,
Instance
:
instance
,
}
}
database
.
Db
.
Create
(
&
dbValue
)
valuesToInsert
=
append
(
valuesToInsert
,
dbValue
)
}
}
database
.
Db
.
Create
(
&
valuesToInsert
)
log
.
Log
.
Info
(
"Stored boiler data in database"
)
log
.
Log
.
Info
(
"Stored boiler data in database"
)
}()
}()
}
}
...
...
...
...
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