Created
January 13, 2010 06:07
-
-
Save mikhailov/275977 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Checking the memcached & sphinx running | |
if $0 == 'script/server' | |
# Check for memcached | |
begin | |
# check if memcached is running; if it is, use that instead of the default memory cache | |
Timeout.timeout(0.5) { TCPSocket.open("localhost", 11211) { } } | |
config.cache_store = :mem_cache_store, %w(localhost:11211), { :namespace => 'zimaletto', :timeout => 60 } | |
$stderr.puts "\033[0;32mUsing memcached on localhost:11211\033[0;34m" | |
rescue StandardError | |
$stderr.puts "\033[0;34mmemcached not running, you should run of \033[0;31mmemcached -d -m 128\033[0;29m" | |
raise | |
end | |
# Check for sphinx | |
begin | |
# check if memcached is running; if it is, use that instead of the default memory cache | |
Timeout.timeout(0.5) { TCPSocket.open("localhost", 9312) { } } | |
$stderr.puts "\033[0;32mUsing sphinx on localhost:9312\033[0;29m" | |
rescue StandardError | |
$stderr.puts "\033[0;34msphinx not running, you should run of \033[0;31mrake ts:start\033[0;29m" | |
raise | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment