Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cs_comments_service
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
cs_comments_service
Commits
28f2a9eb
Commit
28f2a9eb
authored
Dec 12, 2013
by
Jim Abramson
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #75 from edx/feature/jsa/mongoid-retry
Fail fast when database is unreachable
parents
1ae94b55
04aa4362
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
38 additions
and
34 deletions
+38
-34
Gemfile
+1
-1
Gemfile.lock
+7
-7
config/mongoid.yml
+15
-23
config/unicorn.rb
+10
-0
lib/helpers.rb
+1
-1
models/comment_thread.rb
+4
-2
No files found.
Gemfile
View file @
28f2a9eb
...
...
@@ -18,7 +18,7 @@ gem 'ampex'
gem
'
mongo
'
gem
'
moped
'
,
"1.5.1"
gem
'
mongoid
'
,
"
~> 3.0
"
gem
'
mongoid
'
,
"
3.0.15
"
gem
'
bson_ext
'
gem
'
delayed_job
'
...
...
Gemfile.lock
View file @
28f2a9eb
...
...
@@ -67,7 +67,7 @@ GEM
bson (1.6.4)
bson_ext (1.6.4)
bson (~> 1.6.4)
builder (3.0.
0
)
builder (3.0.
4
)
coderay (1.0.7)
dalli (2.1.0)
delayed_job (3.0.3)
...
...
@@ -83,7 +83,7 @@ GEM
guard (>= 1.1)
hashr (0.0.21)
hike (1.2.1)
i18n (0.6.
0
)
i18n (0.6.
9
)
journey (1.0.4)
kgio (2.7.4)
listen (0.5.0)
...
...
@@ -91,19 +91,19 @@ GEM
mime-types (1.19)
mongo (1.6.4)
bson (~> 1.6.4)
mongoid (3.0.
4
)
mongoid (3.0.
15
)
activemodel (~> 3.1)
moped (~> 1.1)
origin (~> 1.0)
tzinfo (~> 0.3.22)
moped (1.5.1)
multi_json (1.
3.6
)
multi_json (1.
8.2
)
newrelic_moped (0.0.6)
moped
newrelic_rpm (~> 3.6.0)
newrelic_rpm (3.6.8.164)
nokogiri (1.5.5)
origin (1.
0.6
)
origin (1.
1.0
)
pry (0.9.10)
coderay (~> 1.0.5)
method_source (~> 0.8)
...
...
@@ -154,7 +154,7 @@ GEM
rest-client (~> 1.6)
tire-contrib (0.1.1)
tire
tzinfo (0.3.3
3
)
tzinfo (0.3.3
8
)
unicorn (4.3.1)
kgio (~> 2.6)
rack
...
...
@@ -180,7 +180,7 @@ DEPENDENCIES
guard-unicorn
kaminari!
mongo
mongoid (
~> 3.0
)
mongoid (
= 3.0.15
)
mongoid-tree!
mongoid_magic_counter_cache!
mongoid_taggable_with_context!
...
...
config/mongoid.yml
View file @
28f2a9eb
...
...
@@ -11,48 +11,40 @@ test:
hosts
:
-
localhost:27017
common
:
&default_session
uri
:
<%= ENV['MONGOHQ_URL'] %>
options
:
skip_version_check
:
true
safe
:
true
consistency
:
strong
max_retries
:
<%= ENV['MONGOID_MAX_RETRIES'] || 1 %>
retry_interval
:
<%= ENV['MONGOID_RETRY_INTERVAL'] || 0 %>
timeout
:
<%= ENV['MONGOID_TIMEOUT'] || 0.5 %>
production
:
sessions
:
default
:
uri
:
<%= ENV['MONGOHQ_URL'] %>
options
:
skip_version_check
:
true
safe
:
true
consistency
:
strong
<<
:
*default_session
edgeprod
:
sessions
:
default
:
uri
:
<%= ENV['MONGOHQ_URL'] %>
options
:
skip_version_check
:
true
safe
:
true
consistency
:
strong
<<
:
*default_session
edgestage
:
sessions
:
default
:
uri
:
<%= ENV['MONGOHQ_URL'] %>
options
:
skip_version_check
:
true
safe
:
true
consistency
:
strong
<<
:
*default_session
staging
:
sessions
:
default
:
uri
:
<%= ENV['MONGOHQ_URL'] %>
<<
:
*default_session
loadtest
:
sessions
:
default
:
uri
:
<%= ENV['MONGOHQ_URL'] %>
options
:
skip_version_check
:
true
safe
:
true
consistency
:
strong
max_retries
:
1
retry_interval
:
1
<<
:
*default_session
defaults
:
&defaults
use_utc
:
false
...
...
config/unicorn.rb
View file @
28f2a9eb
...
...
@@ -2,6 +2,16 @@ worker_processes 4
timeout
25
preload_app
true
before_fork
do
|
server
,
worker
|
Signal
.
trap
'TERM'
do
puts
'Unicorn master intercepting TERM and sending myself QUIT instead'
Process
.
kill
'QUIT'
,
Process
.
pid
end
end
after_fork
do
|
server
,
worker
|
Signal
.
trap
'TERM'
do
puts
'Unicorn worker intercepting TERM and doing nothing. Waiting for master to send QUIT'
end
::
Mongoid
.
default_session
.
disconnect
end
lib/helpers.rb
View file @
28f2a9eb
...
...
@@ -299,7 +299,7 @@ helpers do
add_method_tracer
:thread
add_method_tracer
:comment
add_method_tracer
:flag_as_abuse
add_method_tracer
:unflag_as_abuse
add_method_tracer
:un
_
flag_as_abuse
add_method_tracer
:author_contents_only
add_method_tracer
:handle_threads_query
...
...
models/comment_thread.rb
View file @
28f2a9eb
...
...
@@ -309,7 +309,9 @@ private
subscriptions
.
delete_all
end
include
::
NewRelic
::
Agent
::
MethodTracer
add_method_tracer
:perform_search
class
<<
self
include
::
NewRelic
::
Agent
::
MethodTracer
add_method_tracer
:perform_search
,
'Custom/perform_search'
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment