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:
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