diff --git a/app/models/miq_schedule.rb b/app/models/miq_schedule.rb index 09b0d4149b5..56f8ddf5d1f 100644 --- a/app/models/miq_schedule.rb +++ b/app/models/miq_schedule.rb @@ -240,7 +240,8 @@ def action_db_backup(klass, _at) opts = self.sched_action[:options] opts[:file_depot_id] = file_depot.id opts[:miq_schedule_id] = id - queue_opts = {:class_name => klass.name, :method_name => "backup", :msg_timeout => 3600, :args => [opts], :role => "database_operations"} + queue_opts = {:class_name => klass.name, :method_name => "backup", :args => [opts], :role => "database_operations", + :msg_timeout => ::Settings.task.active_task_timeout.to_i_with_method} task_opts = {:action => "Database backup", :userid => self.sched_action[:options][:userid]} MiqTask.generic_action_with_callback(task_opts, queue_opts) end diff --git a/spec/models/miq_schedule_spec.rb b/spec/models/miq_schedule_spec.rb index 55f9f3fd0a8..c146c97388b 100644 --- a/spec/models/miq_schedule_spec.rb +++ b/spec/models/miq_schedule_spec.rb @@ -569,6 +569,10 @@ it "should create one backup queue message for our db backup instance for the database role" do expect(MiqQueue.where(:class_name => "DatabaseBackup", :method_name => "backup", :role => "database_operations").count).to eq(1) end + + it "sets backup tasks's timeout to ::Settings.task.active_task_timeout" do + expect(@backup_message.msg_timeout).to eq ::Settings.task.active_task_timeout.to_i_with_method + end end context "calling queue scheduled work via a db_backup schedule firing" do