Class: Webhookdb::Jobs::BackoffShouldBeRescheduled

Inherits:
Object
  • Object
show all
Includes:
Amigo::DurableJob, Amigo::QueueBackoffJob, Sidekiq::Job
Defined in:
lib/webhookdb/jobs/amigo_test_jobs.rb

Overview

Use this and BackoffShouldBeRun to test the behavior of BackoffJob.

First, fill up the ‘netout’ queue with a ton of these slow jobs: From pry: ‘Webhookdb::Async.require_jobs; 500.times { Webhookdb::Jobs::BackoffShouldBeRescheduled.perform_async }`

Then, fill up the other queues with fast jobs: ‘1000.times { Webhookdb::Jobs::BackoffShouldRun.perform_async }`

Then go to localhost:18001/sidekiq (user/pass) to check the latency. The netout queue should get slow, but the other queues should not build up much of a backlog.

Instance Method Summary collapse

Methods included from Amigo::DurableJob

enabled?, ensure_jobs_tables, heartbeat, heartbeat!, included, insert_job, lock_job, poll_jobs, reconnect, replace_database_settings, set_database_setting, storage_datasets, unlock_job

Instance Method Details

#perform(duration = 3) ⇒ Object



83
84
85
# File 'lib/webhookdb/jobs/amigo_test_jobs.rb', line 83

def perform(duration=3)
  sleep(duration)
end