doc/SidekiqUniqueJobs/Orphans/ReaperResurrector.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
Module: SidekiqUniqueJobs::Orphans::ReaperResurrector
— Documentation by YARD 0.9.26
</title>
<link rel="stylesheet" href="../../css/style.css" type="text/css" />
<link rel="stylesheet" href="../../css/common.css" type="text/css" />
<script type="text/javascript">
pathId = "SidekiqUniqueJobs::Orphans::ReaperResurrector";
relpath = '../../';
</script>
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
</head>
<body>
<div class="nav_wrap">
<iframe id="nav" src="../../class_list.html?1"></iframe>
<div id="resizer"></div>
</div>
<div id="main" tabindex="-1">
<div id="header">
<div id="menu">
<a href="../../_index.html">Index (R)</a> »
<span class='title'><span class='object_link'><a href="../../SidekiqUniqueJobs.html" title="SidekiqUniqueJobs (module)">SidekiqUniqueJobs</a></span></span> » <span class='title'><span class='object_link'><a href="../Orphans.html" title="SidekiqUniqueJobs::Orphans (module)">Orphans</a></span></span>
»
<span class="title">ReaperResurrector</span>
</div>
<div id="search">
<a class="full_list_link" id="class_list_link"
href="../../class_list.html">
<svg width="24" height="24">
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
</svg>
</a>
</div>
<div class="clear"></div>
</div>
<div id="content"><h1>Module: SidekiqUniqueJobs::Orphans::ReaperResurrector
</h1>
<div class="box_info">
<dl>
<dt>Defined in:</dt>
<dd>lib/sidekiq_unique_jobs/orphans/reaper_resurrector.rb</dd>
</dl>
</div>
<h2>Overview</h2><div class="docstring">
<div class="discussion">
<p>Restarts orphan manager if it is considered dead</p>
</div>
</div>
<div class="tags">
</div>
<h2>
Constant Summary
<small><a href="#" class="constants_summary_toggle">collapse</a></small>
</h2>
<dl class="constants">
<dt id="DRIFT_FACTOR-constant" class="">DRIFT_FACTOR =
</dt>
<dd><pre class="code"><span class='float'>0.1</span></pre></dd>
<dt id="REAPERS-constant" class="">REAPERS =
</dt>
<dd><pre class="code"><span class='lbracket'>[</span><span class='symbol'>:ruby</span><span class='comma'>,</span> <span class='symbol'>:lua</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span></pre></dd>
</dl>
<h2>
Class Method Summary
<small><a href="#" class="summary_toggle">collapse</a></small>
</h2>
<ul class="summary">
<li class="public ">
<span class="summary_signature">
<a href="#current_timestamp-class_method" title="current_timestamp (class method)">.<strong>current_timestamp</strong> ⇒ Object </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#drift_reaper_interval-class_method" title="drift_reaper_interval (class method)">.<strong>drift_reaper_interval</strong> ⇒ Object </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#logging_context-class_method" title="logging_context (class method)">.<strong>logging_context</strong> ⇒ Hash, String </a>
</span>
<span class="summary_desc"><div class='inline'><p>A context to use for all log entries.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#orphans_manager-class_method" title="orphans_manager (class method)">.<strong>orphans_manager</strong> ⇒ SidekiqUniqueJobs::Orphans::Manager </a>
</span>
<span class="summary_desc"><div class='inline'><p>Returns orphan manager.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#reaper-class_method" title="reaper (class method)">.<strong>reaper</strong> ⇒ Object </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#reaper_disabled%3F-class_method" title="reaper_disabled? (class method)">.<strong>reaper_disabled?</strong> ⇒ true, false </a>
</span>
<span class="summary_desc"><div class='inline'><p>Checks if reaping is disabled.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#reaper_enabled%3F-class_method" title="reaper_enabled? (class method)">.<strong>reaper_enabled?</strong> ⇒ true, false </a>
</span>
<span class="summary_desc"><div class='inline'><p>Checks if reaping is enabled.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#reaper_interval-class_method" title="reaper_interval (class method)">.<strong>reaper_interval</strong> ⇒ Object </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#reaper_registered%3F-class_method" title="reaper_registered? (class method)">.<strong>reaper_registered?</strong> ⇒ true, false </a>
</span>
<span class="summary_desc"><div class='inline'><p>Checks if reaper is registered.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#reaper_resurrector_interval-class_method" title="reaper_resurrector_interval (class method)">.<strong>reaper_resurrector_interval</strong> ⇒ Object </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#restart_if_dead-class_method" title="restart_if_dead (class method)">.<strong>restart_if_dead</strong> ⇒ Object </a>
</span>
<span class="summary_desc"><div class='inline'><p>Starts new instance of orphan reaper if reaper is considered dead (reaper mutex has not been refreshed lately).</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#resurrector_disabled%3F-class_method" title="resurrector_disabled? (class method)">.<strong>resurrector_disabled?</strong> ⇒ true, false </a>
</span>
<span class="summary_desc"><div class='inline'><p>Checks if resurrector is disabled.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#resurrector_enabled%3F-class_method" title="resurrector_enabled? (class method)">.<strong>resurrector_enabled?</strong> ⇒ true, false </a>
</span>
<span class="summary_desc"><div class='inline'><p>Checks if resurrector is enabled.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#run_task-class_method" title="run_task (class method)">.<strong>run_task</strong> ⇒ SidekiqUniqueJobs::TimerTask </a>
</span>
<span class="summary_desc"><div class='inline'><p>Runs reaper resurrector task.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#start-class_method" title="start (class method)">.<strong>start</strong> ⇒ SidekiqUniqueJobs::TimerTask </a>
</span>
<span class="summary_desc"><div class='inline'><p>Starts reaper resurrector that watches orphans reaper.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#task-class_method" title="task (class method)">.<strong>task</strong> ⇒ SidekiqUniqueJobs::TimerTask </a>
</span>
<span class="summary_desc"><div class='inline'><p>The task that runs the resurrector.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#timer_task_options-class_method" title="timer_task_options (class method)">.<strong>timer_task_options</strong> ⇒ Hash </a>
</span>
<span class="summary_desc"><div class='inline'><p>Arguments passed on to the timer task.</p>
</div></span>
</li>
</ul>
<div id="class_method_details" class="method_details_list">
<h2>Class Method Details</h2>
<div class="method_details first">
<h3 class="signature first" id="current_timestamp-class_method">
.<strong>current_timestamp</strong> ⇒ <tt>Object</tt>
</h3><table class="source_code">
<tr>
<td>
<pre class="lines">
165
166
167</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/sidekiq_unique_jobs/orphans/reaper_resurrector.rb', line 165</span>
<span class='kw'>def</span> <span class='id identifier rubyid_current_timestamp'>current_timestamp</span>
<span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_now'>now</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="drift_reaper_interval-class_method">
.<strong>drift_reaper_interval</strong> ⇒ <tt>Object</tt>
</h3><table class="source_code">
<tr>
<td>
<pre class="lines">
161
162
163</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/sidekiq_unique_jobs/orphans/reaper_resurrector.rb', line 161</span>
<span class='kw'>def</span> <span class='id identifier rubyid_drift_reaper_interval'>drift_reaper_interval</span>
<span class='id identifier rubyid_reaper_interval'>reaper_interval</span> <span class='op'>+</span> <span class='lparen'>(</span><span class='id identifier rubyid_reaper_interval'>reaper_interval</span> <span class='op'>*</span> <span class='const'><span class='object_link'><a href="#DRIFT_FACTOR-constant" title="SidekiqUniqueJobs::Orphans::ReaperResurrector::DRIFT_FACTOR (constant)">DRIFT_FACTOR</a></span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="logging_context-class_method">
.<strong>logging_context</strong> ⇒ <tt><span class='object_link'><a href="../../Hash.html" title="Hash (class)">Hash</a></span></tt>, <tt>String</tt>
</h3><div class="docstring">
<div class="discussion">
<p>A context to use for all log entries</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt><span class='object_link'><a href="../../Hash.html" title="Hash (class)">Hash</a></span></tt>)</span>
—
<div class='inline'><p>when logger responds to <code>:with_context</code></p>
</div>
</li>
<li>
<span class='type'>(<tt>String</tt>)</span>
—
<div class='inline'><p>when logger does not responds to <code>:with_context</code></p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
142
143
144
145
146
147
148</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/sidekiq_unique_jobs/orphans/reaper_resurrector.rb', line 142</span>
<span class='kw'>def</span> <span class='id identifier rubyid_logging_context'>logging_context</span>
<span class='kw'>if</span> <span class='id identifier rubyid_logger_context_hash?'>logger_context_hash?</span>
<span class='lbrace'>{</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>uniquejobs</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>reaper-resurrector</span><span class='tstring_end'>"</span></span> <span class='rbrace'>}</span>
<span class='kw'>else</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>uniquejobs=reaper-resurrector</span><span class='tstring_end'>"</span></span>
<span class='kw'>end</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="orphans_manager-class_method">
.<strong>orphans_manager</strong> ⇒ <tt><span class='object_link'><a href="Manager.html" title="SidekiqUniqueJobs::Orphans::Manager (module)">SidekiqUniqueJobs::Orphans::Manager</a></span></tt>
</h3><div class="docstring">
<div class="discussion">
<p>Returns orphan manager</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt><span class='object_link'><a href="Manager.html" title="SidekiqUniqueJobs::Orphans::Manager (module)">SidekiqUniqueJobs::Orphans::Manager</a></span></tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
65
66
67</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/sidekiq_unique_jobs/orphans/reaper_resurrector.rb', line 65</span>
<span class='kw'>def</span> <span class='id identifier rubyid_orphans_manager'>orphans_manager</span>
<span class='const'><span class='object_link'><a href="../../SidekiqUniqueJobs.html" title="SidekiqUniqueJobs (module)">SidekiqUniqueJobs</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Orphans.html" title="SidekiqUniqueJobs::Orphans (module)">Orphans</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Manager.html" title="SidekiqUniqueJobs::Orphans::Manager (module)">Manager</a></span></span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="reaper-class_method">
.<strong>reaper</strong> ⇒ <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
</div>
</div>
<div class="tags">
<p class="tag_title">See Also:</p>
<ul class="see">
<li>Config#reaper</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
120
121
122</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/sidekiq_unique_jobs/orphans/reaper_resurrector.rb', line 120</span>
<span class='kw'>def</span> <span class='id identifier rubyid_reaper'>reaper</span>
<span class='const'><span class='object_link'><a href="../../SidekiqUniqueJobs.html" title="SidekiqUniqueJobs (module)">SidekiqUniqueJobs</a></span></span><span class='period'>.</span><span class='id identifier rubyid_config'><span class='object_link'><a href="../../SidekiqUniqueJobs.html#config-class_method" title="SidekiqUniqueJobs.config (method)">config</a></span></span><span class='period'>.</span><span class='id identifier rubyid_reaper'>reaper</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="reaper_disabled?-class_method">
.<strong>reaper_disabled?</strong> ⇒ <tt>true</tt>, <tt>false</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Checks if reaping is disabled</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>true</tt>, <tt>false</tt>)</span>
</li>
</ul>
<p class="tag_title">See Also:</p>
<ul class="see">
<li><span class='object_link'><a href="#reaper_enabled%3F-class_method" title="SidekiqUniqueJobs::Orphans::ReaperResurrector.reaper_enabled? (method)">reaper_enabled?</a></span></li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
94
95
96</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/sidekiq_unique_jobs/orphans/reaper_resurrector.rb', line 94</span>
<span class='kw'>def</span> <span class='id identifier rubyid_reaper_disabled?'>reaper_disabled?</span>
<span class='op'>!</span><span class='id identifier rubyid_reaper_enabled?'>reaper_enabled?</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="reaper_enabled?-class_method">
.<strong>reaper_enabled?</strong> ⇒ <tt>true</tt>, <tt>false</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Checks if reaping is enabled</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>true</tt>, <tt>false</tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
103
104
105</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/sidekiq_unique_jobs/orphans/reaper_resurrector.rb', line 103</span>
<span class='kw'>def</span> <span class='id identifier rubyid_reaper_enabled?'>reaper_enabled?</span>
<span class='const'><span class='object_link'><a href="#REAPERS-constant" title="SidekiqUniqueJobs::Orphans::ReaperResurrector::REAPERS (constant)">REAPERS</a></span></span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_reaper'>reaper</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="reaper_interval-class_method">
.<strong>reaper_interval</strong> ⇒ <tt>Object</tt>
</h3><table class="source_code">
<tr>
<td>
<pre class="lines">
157
158
159</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/sidekiq_unique_jobs/orphans/reaper_resurrector.rb', line 157</span>
<span class='kw'>def</span> <span class='id identifier rubyid_reaper_interval'>reaper_interval</span>
<span class='const'><span class='object_link'><a href="../../SidekiqUniqueJobs.html" title="SidekiqUniqueJobs (module)">SidekiqUniqueJobs</a></span></span><span class='period'>.</span><span class='id identifier rubyid_config'><span class='object_link'><a href="../../SidekiqUniqueJobs.html#config-class_method" title="SidekiqUniqueJobs.config (method)">config</a></span></span><span class='period'>.</span><span class='id identifier rubyid_reaper_interval'>reaper_interval</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="reaper_registered?-class_method">
.<strong>reaper_registered?</strong> ⇒ <tt>true</tt>, <tt>false</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Checks if reaper is registered</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>true</tt>, <tt>false</tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
111
112
113
114
115</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/sidekiq_unique_jobs/orphans/reaper_resurrector.rb', line 111</span>
<span class='kw'>def</span> <span class='id identifier rubyid_reaper_registered?'>reaper_registered?</span>
<span class='id identifier rubyid_redis'>redis</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_conn'>conn</span><span class='op'>|</span>
<span class='id identifier rubyid_conn'>conn</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../../SidekiqUniqueJobs.html#UNIQUE_REAPER-constant" title="SidekiqUniqueJobs::UNIQUE_REAPER (constant)">UNIQUE_REAPER</a></span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span> <span class='op'>+</span> <span class='id identifier rubyid_drift_reaper_interval'>drift_reaper_interval</span> <span class='op'>></span> <span class='id identifier rubyid_current_timestamp'>current_timestamp</span>
<span class='kw'>end</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="reaper_resurrector_interval-class_method">
.<strong>reaper_resurrector_interval</strong> ⇒ <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
</div>
</div>
<div class="tags">
<p class="tag_title">See Also:</p>
<ul class="see">
<li>Config#reaper_resurrector_interval</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
153
154
155</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/sidekiq_unique_jobs/orphans/reaper_resurrector.rb', line 153</span>
<span class='kw'>def</span> <span class='id identifier rubyid_reaper_resurrector_interval'>reaper_resurrector_interval</span>
<span class='const'><span class='object_link'><a href="../../SidekiqUniqueJobs.html" title="SidekiqUniqueJobs (module)">SidekiqUniqueJobs</a></span></span><span class='period'>.</span><span class='id identifier rubyid_config'><span class='object_link'><a href="../../SidekiqUniqueJobs.html#config-class_method" title="SidekiqUniqueJobs.config (method)">config</a></span></span><span class='period'>.</span><span class='id identifier rubyid_reaper_resurrector_interval'>reaper_resurrector_interval</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="restart_if_dead-class_method">
.<strong>restart_if_dead</strong> ⇒ <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Starts new instance of orphan reaper if reaper is considered dead (reaper mutex has not been refreshed lately)</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
54
55
56
57
58
59</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/sidekiq_unique_jobs/orphans/reaper_resurrector.rb', line 54</span>
<span class='kw'>def</span> <span class='id identifier rubyid_restart_if_dead'>restart_if_dead</span>
<span class='kw'>return</span> <span class='kw'>if</span> <span class='id identifier rubyid_reaper_registered?'>reaper_registered?</span>
<span class='id identifier rubyid_log_info'>log_info</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Reaper is considered dead. Starting new reaper instance</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='id identifier rubyid_orphans_manager'>orphans_manager</span><span class='period'>.</span><span class='id identifier rubyid_start'>start</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="resurrector_disabled?-class_method">
.<strong>resurrector_disabled?</strong> ⇒ <tt>true</tt>, <tt>false</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Checks if resurrector is disabled</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>true</tt>, <tt>false</tt>)</span>
</li>
</ul>
<p class="tag_title">See Also:</p>
<ul class="see">
<li><span class='object_link'><a href="#resurrector_enabled%3F-class_method" title="SidekiqUniqueJobs::Orphans::ReaperResurrector.resurrector_enabled? (method)">resurrector_enabled?</a></span></li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
75
76
77</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/sidekiq_unique_jobs/orphans/reaper_resurrector.rb', line 75</span>
<span class='kw'>def</span> <span class='id identifier rubyid_resurrector_disabled?'>resurrector_disabled?</span>
<span class='op'>!</span><span class='id identifier rubyid_resurrector_enabled?'>resurrector_enabled?</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="resurrector_enabled?-class_method">
.<strong>resurrector_enabled?</strong> ⇒ <tt>true</tt>, <tt>false</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Checks if resurrector is enabled</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>true</tt>, <tt>false</tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
83
84
85</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/sidekiq_unique_jobs/orphans/reaper_resurrector.rb', line 83</span>
<span class='kw'>def</span> <span class='id identifier rubyid_resurrector_enabled?'>resurrector_enabled?</span>
<span class='const'><span class='object_link'><a href="../../SidekiqUniqueJobs.html" title="SidekiqUniqueJobs (module)">SidekiqUniqueJobs</a></span></span><span class='period'>.</span><span class='id identifier rubyid_config'><span class='object_link'><a href="../../SidekiqUniqueJobs.html#config-class_method" title="SidekiqUniqueJobs.config (method)">config</a></span></span><span class='period'>.</span><span class='id identifier rubyid_reaper_resurrector_enabled'>reaper_resurrector_enabled</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="run_task-class_method">
.<strong>run_task</strong> ⇒ <tt><span class='object_link'><a href="../TimerTask.html" title="SidekiqUniqueJobs::TimerTask (class)">SidekiqUniqueJobs::TimerTask</a></span></tt>
</h3><div class="docstring">
<div class="discussion">
<p>Runs reaper resurrector task</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt><span class='object_link'><a href="../TimerTask.html" title="SidekiqUniqueJobs::TimerTask (class)">SidekiqUniqueJobs::TimerTask</a></span></tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
33
34
35
36
37</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/sidekiq_unique_jobs/orphans/reaper_resurrector.rb', line 33</span>
<span class='kw'>def</span> <span class='id identifier rubyid_run_task'>run_task</span>
<span class='id identifier rubyid_log_info'>log_info</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Starting Reaper Resurrector</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='id identifier rubyid_task'>task</span><span class='period'>.</span><span class='id identifier rubyid_execute'>execute</span>
<span class='id identifier rubyid_task'>task</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="start-class_method">
.<strong>start</strong> ⇒ <tt><span class='object_link'><a href="../TimerTask.html" title="SidekiqUniqueJobs::TimerTask (class)">SidekiqUniqueJobs::TimerTask</a></span></tt>
</h3><div class="docstring">
<div class="discussion">
<p>Starts reaper resurrector that watches orphans reaper</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt><span class='object_link'><a href="../TimerTask.html" title="SidekiqUniqueJobs::TimerTask (class)">SidekiqUniqueJobs::TimerTask</a></span></tt>)</span>
—
<div class='inline'><p>the task that was started</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
20
21
22
23
24
25
26
27</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/sidekiq_unique_jobs/orphans/reaper_resurrector.rb', line 20</span>
<span class='kw'>def</span> <span class='id identifier rubyid_start'>start</span>
<span class='kw'>return</span> <span class='kw'>if</span> <span class='id identifier rubyid_resurrector_disabled?'>resurrector_disabled?</span>
<span class='kw'>return</span> <span class='kw'>if</span> <span class='id identifier rubyid_reaper_disabled?'>reaper_disabled?</span>
<span class='id identifier rubyid_with_logging_context'>with_logging_context</span> <span class='kw'>do</span>
<span class='id identifier rubyid_run_task'>run_task</span>
<span class='kw'>end</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="task-class_method">
.<strong>task</strong> ⇒ <tt><span class='object_link'><a href="../TimerTask.html" title="SidekiqUniqueJobs::TimerTask (class)">SidekiqUniqueJobs::TimerTask</a></span></tt>
</h3><div class="docstring">
<div class="discussion">
<p>The task that runs the resurrector</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt><span class='object_link'><a href="../TimerTask.html" title="SidekiqUniqueJobs::TimerTask (class)">SidekiqUniqueJobs::TimerTask</a></span></tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
43
44
45
46
47
48
49</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/sidekiq_unique_jobs/orphans/reaper_resurrector.rb', line 43</span>
<span class='kw'>def</span> <span class='id identifier rubyid_task'>task</span>
<span class='const'><span class='object_link'><a href="../../SidekiqUniqueJobs.html" title="SidekiqUniqueJobs (module)">SidekiqUniqueJobs</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../TimerTask.html" title="SidekiqUniqueJobs::TimerTask (class)">TimerTask</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_timer_task_options'>timer_task_options</span><span class='rparen'>)</span> <span class='kw'>do</span>
<span class='id identifier rubyid_with_logging_context'>with_logging_context</span> <span class='kw'>do</span>
<span class='id identifier rubyid_restart_if_dead'>restart_if_dead</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="timer_task_options-class_method">
.<strong>timer_task_options</strong> ⇒ <tt><span class='object_link'><a href="../../Hash.html" title="Hash (class)">Hash</a></span></tt>
</h3><div class="docstring">
<div class="discussion">
<p>Arguments passed on to the timer task</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt><span class='object_link'><a href="../../Hash.html" title="Hash (class)">Hash</a></span></tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
130
131
132
133</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/sidekiq_unique_jobs/orphans/reaper_resurrector.rb', line 130</span>
<span class='kw'>def</span> <span class='id identifier rubyid_timer_task_options'>timer_task_options</span>
<span class='lbrace'>{</span> <span class='label'>run_now:</span> <span class='kw'>false</span><span class='comma'>,</span>
<span class='label'>execution_interval:</span> <span class='id identifier rubyid_reaper_resurrector_interval'>reaper_resurrector_interval</span> <span class='rbrace'>}</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
</div>
<div id="footer">
Generated on Mon Sep 27 15:29:06 2021 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.26 (ruby-3.0.2).
</div>
</div>
</body>
</html>