Skip to content

Instantly share code, notes, and snippets.

View adamhunter's full-sized avatar

Adam Hunter adamhunter

View GitHub Profile
-module(bucket_reloader).
-export([reload/3]).
reload(FromServer, ToServer, Bucket) ->
{ok, CFrom} = riak:client_connect(FromServer),
{ok, CTo} = riak:client_connect(ToServer),
{ok, Keys} = CFrom:list_keys(Bucket),
io:format("Transferring ~p keys~n", [length(Keys)]),
transfer(CFrom, CTo, Bucket, Keys, 0).
-module(test_helper).
-export([riak_test/1]).
riak_test(Fun) ->
start_riak(),
{ok, Riak} = riak:local_client(),
Ret = (catch Fun(Riak)),
stop_riak(),
case Ret of
# unicorn_rails -c /data/github/current/config/unicorn.rb -E production -D
rails_env = ENV['RAILS_ENV'] || 'production'
# 16 workers and 1 master
worker_processes (rails_env == 'production' ? 16 : 4)
# Load rails+github.git into the master before forking workers
# for super-fast worker spawn times
preload_app true