Fix number of new replies increasing even if reply was not fetched (#35577)

This commit is contained in:
Eugen Rochko authored and GitHub committed 2025-07-29 10:47:18 +00:00
1 parent 20bbd20ef1
commit a368b29e27
1 file changed
+3 -3
+3 -3
View File
@@ -7,9 +7,9 @@ class FetchReplyWorker
sidekiq_options queue: 'pull', retry: 3
def perform(child_url, options = {})
batch = WorkerBatch.new(options.delete('batch_id')) if options['batch_id']
FetchRemoteStatusService.new.call(child_url, **options.symbolize_keys)
batch = WorkerBatch.new(options.delete('batch_id')) if options['batch_id']
result = FetchRemoteStatusService.new.call(child_url, **options.symbolize_keys)
ensure
batch&.remove_job(jid, increment: true)
batch&.remove_job(jid, increment: result.present?)
end
end