diff options
Diffstat (limited to 'lib/gitlab/daemon.rb')
-rw-r--r-- | lib/gitlab/daemon.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/gitlab/daemon.rb b/lib/gitlab/daemon.rb index 8a253893892..ddb9d907640 100644 --- a/lib/gitlab/daemon.rb +++ b/lib/gitlab/daemon.rb @@ -28,6 +28,10 @@ module Gitlab true end + def thread_name + self.class.name.demodulize.underscore + end + def start return unless enabled? @@ -35,7 +39,10 @@ module Gitlab break thread if thread? if start_working - @thread = Thread.new { run_thread } + @thread = Thread.new do + Thread.current.name = thread_name + run_thread + end end end end |