1
0
Fork 0
mirror of https://github.com/mperham/sidekiq.git synced 2022-11-09 13:52:34 -05:00

remove old broken example, fixes #4016

This commit is contained in:
Mike Perham 2018-11-13 10:02:37 -08:00
parent 0e3ff21711
commit 8bdd1d8f3d

View file

@ -1,27 +0,0 @@
# Making sure we do not leak memory
require 'sidekiq'
$c = 0
$max = 10_000
# Start up sidekiq via
# ./bin/sidekiq -r ./examples/leak.rb > /dev/null
class MyWorker
include Sidekiq::Worker
def perform
$c += 1
if $c % 100 == 0
GC.start
memory = `ps -o rss -p #{Process.pid}`.chomp.split("\n").last.to_i
$stderr.puts "Using memory #{memory}"
end
if $c >= $max
exit
end
end
end
# schedule some jobs to work on
$max.times { MyWorker.perform_async }