-
Notifications
You must be signed in to change notification settings - Fork 275
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Start Neo4j on app startup #238
Conversation
After using this for a little while, I realized that this causes Neo4j to always start up when the Rails environment is loaded, for example when loading the console or running a Rake task. Ideally, it would only start up when launching the Rails server. Not sure what's the best strategy here. |
I didn't realize As discussed in #237, I think we should try to fix the root problem and make Neo4j start up thread safe, and additionally make auto start up configurable. I'll refactor this pull request to add the configuration option. |
Great thanks ! |
I modified this pull request to use I would consider this setting to be a workaround until we figure out how to make Neo4j.start threadsafe. Using this setting inherently makes it threadsafe because the server won't accept any requests (and hence won't launch any threads) until the whole app has initialized. |
Looks like this is solved in neo4jrb/neo4j-core#23 |
Hi @andreasronge, I upgraded to the latest Neo4j (with thread safe start) and turned off auto start. However, I found this to be less than ideal because the first request to the app has to wait for Neo4j to start. This can take many seconds. Ideally the app won't accept any requests until Neo4j is already started up. I think auto start should be included as a part of Neo4j. Personally, I prefer Neo4j to auto-start in all environments except development. I'd like to submit a new pull request with improved implementation if you think this is a good feature to include. |
Yes I think so - there should be a default rails configuration (railtie) On Fri, May 24, 2013 at 10:01 PM, David Butler notifications@github.comwrote:
|
As discussed in #237, Neo4j startup seems to not be thread safe. Until we can figure out the root cause, this patch simply starts up Neo4j on app startup if config.threadsafe! is enabled. This works for me and resolves the issues I was having.