Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Add support for specifying max slave count via SPORK_SLAVES_COUNT #216

Closed
wants to merge 1 commit into from

3 participants

@jarmo

Add support for specifying max magazine slave count via SPORK_SLAVES_COUNT environment variable.

@kevinzen

+1

I implemented a version of this feature in a situation where I was using JRUBY which forced the magazine strategy and our team loads some test data into the test database as a part of loading spec_helper.rb.

Having multiple spork slaves caused problems because both slaves tried to load the test data into the test database and caused conflicts. We needed to force it to a single slave to make it work.

This should be an environment variable, or command line switch or something.

@sahilm
Owner

Closing old pull requests. Please send new ones if this is still an issue.

@sahilm sahilm closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 27, 2012
  1. @jarmo

    Add support for specifying max slave count via SPORK_SLAVES_COUNT env…

    jarmo authored
    …ironment variable using magazine run strategy.
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/spork/run_strategy/magazine.rb
View
2  lib/spork/run_strategy/magazine.rb
@@ -19,7 +19,7 @@
class Spork::RunStrategy::Magazine < Spork::RunStrategy
- Slave_Id_Range = 1..2 # Ringserver uses id: 0. Slave use: 1..MAX_SLAVES
+ Slave_Id_Range = 1..(ENV["SPORK_SLAVES_COUNT"] && ENV["SPORK_SLAVES_COUNT"].to_i || 2) # Ringserver uses id: 0. Slave use: 1..MAX_SLAVES
def slave_max
Slave_Id_Range.to_a.size
Something went wrong with that request. Please try again.