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
Commits
8d575c14
Verified
Commit
8d575c14
authored
1 year ago
by
Volker Schukai
Browse files
Options
Downloads
Patches
Plain Diff
fix: dissolve dead lock.
#7
parent
a8d49f6a
Branches
Branches containing commit
Tags
v1.5.1
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
database.go
+7
-4
7 additions, 4 deletions
database.go
with
7 additions
and
4 deletions
database.go
+
7
−
4
View file @
8d575c14
...
...
@@ -50,9 +50,12 @@ func (s *DBSaver) setStatus(status DBSaverStatus) *DBSaver {
}
// isStatus returns true if the DBSaver has the given status
func
(
s
*
DBSaver
)
isStatus
(
status
DBSaverStatus
)
bool
{
// the lock is not needed here, because it is only used in the Start() method
func
(
s
*
DBSaver
)
isStatus
(
status
DBSaverStatus
,
lock
bool
)
bool
{
if
lock
{
s
.
mu
.
Lock
()
defer
s
.
mu
.
Unlock
()
}
return
s
.
status
==
status
...
...
@@ -67,7 +70,7 @@ func (s *DBSaver) Start() error {
return
ErrNoDatabaseConnection
}
if
s
.
isStatus
(
DBSaverStatusRunning
)
{
if
s
.
isStatus
(
DBSaverStatusRunning
,
false
)
{
return
nil
}
...
...
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