Signed-off-by: Wei Jihui weijihuiall@163.com --- lib/job.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/job.rb b/lib/job.rb index c8893433..fe373e86 100755 --- a/lib/job.rb +++ b/lib/job.rb @@ -584,8 +584,9 @@ class Job
def add_monitors @job[comment_to_symbol('auto generated by add_monitors()')] = nil - @job['monitors'] = {} + @job['monitors'] = nil for_each_in(@job, monitor_params) do |_pk, _h, m_n, _m_args| + @job['monitors'] ||= {} @job['monitors'][m_n] = nil end end