Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Job Queues
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Jira
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Monitor
Service Desk
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OSS
Libraries
Go
Services
Job Queues
Compare revisions
v1.19.3 to v1.19.4
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
oss/libraries/go/services/job-queues
Select target project
No results found
v1.19.4
Select Git revision
Branches
master
Tags
v1.0.0
v1.0.1
v1.1.0
v1.10.0
v1.10.1
v1.10.2
v1.11.0
v1.12.0
v1.12.1
v1.12.2
v1.12.3
v1.12.4
v1.12.5
v1.12.6
v1.12.7
v1.12.8
v1.13.0
v1.13.1
v1.13.2
v1.14.0
v1.15.0
v1.15.1
v1.15.10
v1.15.11
v1.15.12
v1.15.13
v1.15.14
v1.15.15
v1.15.16
v1.15.17
v1.15.2
v1.15.3
v1.15.4
v1.15.5
v1.15.6
v1.15.7
v1.15.8
v1.15.9
v1.16.0
v1.16.1
v1.17.0
v1.18.0
v1.18.1
v1.18.2
v1.19.0
v1.19.1
v1.19.2
v1.19.3
v1.19.4
v1.2.0
v1.20.0
v1.20.1
v1.20.2
v1.20.3
v1.21.0
v1.21.1
v1.22.0
v1.23.0
v1.23.1
v1.23.2
v1.3.0
v1.3.1
v1.3.2
v1.4.0
v1.5.0
v1.5.1
v1.6.0
v1.6.1
v1.7.0
v1.7.1
v1.7.2
v1.7.3
v1.8.0
v1.8.1
v1.9.0
76 results
Swap
Target
oss/libraries/go/services/job-queues
Select target project
oss/libraries/go/services/job-queues
1 result
v1.19.3
Select Git revision
Branches
master
Tags
v1.0.0
v1.0.1
v1.1.0
v1.10.0
v1.10.1
v1.10.2
v1.11.0
v1.12.0
v1.12.1
v1.12.2
v1.12.3
v1.12.4
v1.12.5
v1.12.6
v1.12.7
v1.12.8
v1.13.0
v1.13.1
v1.13.2
v1.14.0
v1.15.0
v1.15.1
v1.15.10
v1.15.11
v1.15.12
v1.15.13
v1.15.14
v1.15.15
v1.15.16
v1.15.17
v1.15.2
v1.15.3
v1.15.4
v1.15.5
v1.15.6
v1.15.7
v1.15.8
v1.15.9
v1.16.0
v1.16.1
v1.17.0
v1.18.0
v1.18.1
v1.18.2
v1.19.0
v1.19.1
v1.19.2
v1.19.3
v1.19.4
v1.2.0
v1.20.0
v1.20.1
v1.20.2
v1.20.3
v1.21.0
v1.21.1
v1.22.0
v1.23.0
v1.23.1
v1.23.2
v1.3.0
v1.3.1
v1.3.2
v1.4.0
v1.5.0
v1.5.1
v1.6.0
v1.6.1
v1.7.0
v1.7.1
v1.7.2
v1.7.3
v1.8.0
v1.8.1
v1.9.0
76 results
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source (2)
fix: update statistic
#69
· 76cb1ad6
Volker Schukai
authored
11 months ago
Verified
76cb1ad6
fix: sql doesn´t work
#70
· 014bde97
Volker Schukai
authored
11 months ago
Verified
014bde97
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
database.go
+11
-5
11 additions, 5 deletions
database.go
manager.go
+3
-1
3 additions, 1 deletion
manager.go
with
14 additions
and
6 deletions
database.go
View file @
014bde97
...
...
@@ -142,12 +142,18 @@ func update(job *JobPersistence, db *gorm.DB) error {
Info
(
"Stats runCount is 0, skipping update"
)
}
if
err
:=
tx
.
Model
(
job
.
Stats
)
.
// if jobs.Stats not exists in database
// create new record
// else update existing record
var
stats
JobStats
tx
.
Model
(
job
.
Stats
)
.
Where
(
"job_id = ?"
,
job
.
ID
)
.
Assign
(
job
.
Stats
)
.
FirstOrCreate
(
&
stats
)
tx
.
Model
(
job
.
Stats
)
.
Select
(
"*"
)
.
Omit
(
"job_id"
,
"created_at"
)
.
Updates
(
job
.
Stats
)
.
Error
;
err
!=
nil
{
return
err
// Fehler beim Update
}
Updates
(
job
.
Stats
)
}
for
i
:=
range
job
.
Logs
{
...
...
@@ -156,7 +162,7 @@ func update(job *JobPersistence, db *gorm.DB) error {
// no error handling, if it fails, it fails
}
return
nil
return
tx
.
Error
})
}
...
...
This diff is collapsed.
Click to expand it.
manager.go
View file @
014bde97
...
...
@@ -249,7 +249,9 @@ func (m *Manager) ResetJobStats(id JobID) error {
m
.
mu
.
Lock
()
defer
m
.
mu
.
Unlock
()
if
_
,
ok
:=
m
.
activeJobs
[
id
];
!
ok
{
if
job
,
ok
:=
m
.
activeJobs
[
id
];
ok
{
job
.
ResetStats
()
}
else
{
return
ErrJobNotActive
}
...
...
This diff is collapsed.
Click to expand it.