• Oswaldo Ferreira's avatar
    Add cop to encourage idempotent Sidekiq workers · f78af0fc
    Oswaldo Ferreira authored
    This commit's goal is to add a cop (Scalability::IdempotentWorker)
    that will catch all workers that don't call idempotent! in its scope.
    
    Calling it will label the worker as idempotent, which will end up in
    our Sidekiq logs for further visibility.
    
    This also introduces a shared example and a perform_multiple helper
    method for executing jobs multiple times through unit tests.
    
    Also in this commit we set an example in an already idempotent worker
    ExpireJobCacheWorker. For this worker we call idempotent! in its
    scope and add tests with the new test helpers.
    f78af0fc
group_destroy_worker.rb 425 Bytes