Skip to content

Commit

Permalink
multiple number of mammoth users
Browse files Browse the repository at this point in the history
  • Loading branch information
jtomchak committed Nov 8, 2023
1 parent 3ad025b commit e70683f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .env.production.sample
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,5 @@ ACCOUNT_RELAY_KEY=xxxxxx
# JWT Decode MAMMOTH AUTHENTICATION
MAMMOTH_SECRET_KEY=xxxxxx

# Multiple number of users to load test the ForYouMammothFeed Scheduler
FOR_YOU_LOAD_TEST_MULTIPLIER=1
4 changes: 3 additions & 1 deletion app/workers/scheduler/for_you_mammoth_scheduler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ class Scheduler::ForYouMammothScheduler

sidekiq_options retry: 0

LOAD_TEST_MULTIPLIER = ENV['FOR_YOU_LOAD_TEST_MULTIPLIER'] || 1

def perform
users = mammoth_users.wait
users.each do |acct|
([users] * LOAD_TEST_MULTIPLIER).inject(&:zip).flatten.each do |acct|
UpdateForYouWorker.perform_async({ acct: acct, rebuild: false })
end
end
Expand Down

0 comments on commit e70683f

Please sign in to comment.