Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
a1434ff5
Commit
a1434ff5
authored
Dec 25, 2012
by
Jakub Jirutka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix shared Redis connection issue on Passenger
parent
4c800342
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
config/initializers/passenger_fix.rb
config/initializers/passenger_fix.rb
+16
-0
No files found.
config/initializers/passenger_fix.rb
0 → 100644
View file @
a1434ff5
if
defined?
(
PhusionPassenger
)
# When you're using Passenger with smart-lv2 (default) or smart spawn method,
# Resque doesn't recognize that it has been forked and should re-establish
# Redis connection. You can see this error message in log:
# Redis::InheritedError, Tried to use a connection from a child process
# without reconnecting. You need to reconnect to Redis after forking.
#
# This solution is based on
# https://github.com/redis/redis-rb/wiki/redis-rb-on-Phusion-Passenger
#
PhusionPassenger
.
on_event
(
:starting_worker_process
)
do
|
forked
|
# if we're in smart spawning mode, reconnect to Redis
Resque
.
redis
.
client
.
reconnect
if
forked
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