Skip to content
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

Local cache to reuse db connection #40

Merged
merged 1 commit into from
Jul 10, 2018
Merged

Conversation

jkraj
Copy link
Contributor

@jkraj jkraj commented Jul 5, 2018

migrate library not closing the db connection db show those connections
are in 'idle' state. When the count reaches the limit database is not
accessible.

so cache the db connection in a map with resource name as key.

more info https://jira.inca.infoblox.com/browse/NGP-1106

dbDriverMap[schema.Namespace+schema.Name] = dbDriver
}

mgrt, err := migrate.NewWithDatabaseInstance(gitURL, dbName, dbDriver)
if err != nil {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This err could be handled. We can check for dbconnection failure and retry

migrate library not closing the db connection db show those connections
are in 'idle' state. When the count reaches the limit database is not
accessible.

so cache the db connection in a map with resouce name as key.
@jkraj
Copy link
Contributor Author

jkraj commented Jul 10, 2018

@chinmayb Created a new issue to track #43

@jkraj jkraj merged commit cc24f83 into infobloxopen:master Jul 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants