mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-27 04:46:41 +00:00
12 lines
225 B
Ruby
12 lines
225 B
Ruby
# frozen_string_literal: true
|
|
|
|
class Mastodon::WorkerBatchMiddleware
|
|
def call(_worker, msg, _queue, _redis_pool = nil)
|
|
if (batch = Thread.current[:batch])
|
|
batch.add_jobs([msg['jid']])
|
|
end
|
|
|
|
yield
|
|
end
|
|
end
|