Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-10-16 12:07:51 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-10-16 12:07:51 +0300
commit914ea32e0efca21436220df2c10e1bfbe4ed3da9 (patch)
treee8eb3b97aea2006bd863c586b7ec41d51f654b3b /lib/gitlab/daemon.rb
parent3546e1bb0971347e9e9984de0799e3fb53743b33 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/daemon.rb')
-rw-r--r--lib/gitlab/daemon.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/gitlab/daemon.rb b/lib/gitlab/daemon.rb
index 43c159fee27..8a253893892 100644
--- a/lib/gitlab/daemon.rb
+++ b/lib/gitlab/daemon.rb
@@ -34,7 +34,9 @@ module Gitlab
@mutex.synchronize do
break thread if thread?
- @thread = Thread.new { start_working }
+ if start_working
+ @thread = Thread.new { run_thread }
+ end
end
end
@@ -57,10 +59,18 @@ module Gitlab
private
+ # Executed in lock context before starting thread
+ # Needs to return success
def start_working
+ true
+ end
+
+ # Executed in separate thread
+ def run_thread
raise NotImplementedError
end
+ # Executed in lock context
def stop_working
# no-ops
end