add the canvas version to delayed_jobs_pool proc name
test plan: with a VERSION file in your rails root, run delayed jobs, the process name will include the contents of the VERSION file. with no VERSION file, it won't. Change-Id: I773ff4ace5facdb48d415ad7528daaf761aeab1d Reviewed-on: https://gerrit.instructure.com/40162 Tested-by: Jenkins <jenkins@instructure.com> Reviewed-by: Cody Cutrer <cody@instructure.com> QA-Review: August Thornton <august@instructure.com> Product-Review: Brian Palmer <brianp@instructure.com>
This commit is contained in:
parent
122c7393c7
commit
d6c9d87f76
|
@ -5,7 +5,7 @@
|
|||
%>
|
||||
|
||||
<span class="small pull-right">
|
||||
Revision: <%= Canvas.revision %>
|
||||
Revision: <%= Canvas.revision || t('#canvas_revision_unknown', "Unknown") %>
|
||||
</span>
|
||||
|
||||
<h2>
|
||||
|
|
|
@ -145,11 +145,12 @@ module Canvas
|
|||
end
|
||||
|
||||
def self.revision
|
||||
return @revision unless @revision.nil?
|
||||
if File.file?(Rails.root+"VERSION")
|
||||
@revision = File.readlines(Rails.root+"VERSION").first.try(:strip)
|
||||
return @revision if defined?(@revision)
|
||||
@revision = if File.file?(Rails.root+"VERSION")
|
||||
File.readlines(Rails.root+"VERSION").first.try(:strip)
|
||||
else
|
||||
nil
|
||||
end
|
||||
@revision ||= I18n.t(:canvas_revision_unknown, "Unknown")
|
||||
end
|
||||
|
||||
# protection against calling external services that could timeout or misbehave.
|
||||
|
|
|
@ -82,12 +82,20 @@ class Pool
|
|||
|
||||
protected
|
||||
|
||||
def procname
|
||||
name = "delayed_jobs_pool"
|
||||
if Canvas.revision
|
||||
name = "#{name} (#{Canvas.revision})"
|
||||
end
|
||||
name
|
||||
end
|
||||
|
||||
def start
|
||||
load_rails
|
||||
tail_rails_log unless @daemon
|
||||
|
||||
say "Started job master", :info
|
||||
$0 = "delayed_jobs_pool"
|
||||
$0 = procname
|
||||
apply_config
|
||||
|
||||
# fork to handle unlocking (to prevent polluting the parent with worker objects)
|
||||
|
|
Loading…
Reference in New Issue