blob: bc8b1989e78692773874091034d3641996db81ed (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
# frozen_string_literal: true
module Gitlab
module SidekiqMiddleware
module SizeLimiter
# This midleware is inserted into Sidekiq **client** middleware chain. It
# prevents the caller from dispatching a too-large job payload. The job
# payload should be small and simple. Read more at:
# https://github.com/mperham/sidekiq/wiki/Best-Practices#1-make-your-job-parameters-small-and-simple
class Client
def call(worker_class, job, queue, _redis_pool)
::Gitlab::SidekiqMiddleware::SizeLimiter::Validator.validate!(worker_class, job)
yield
end
end
end
end
end
|