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

Add link to implementation for CockroachDB #219

Merged
merged 1 commit into from Jul 13, 2020

Conversation

stephenafamo
Copy link
Contributor

@stephenafamo stephenafamo commented Jul 13, 2020

No description provided.

@elithrar
Copy link
Contributor

elithrar commented Jul 13, 2020

Thanks for this - I did however notice that your README example opens a new connection for every client request, as well as leaking goroutines.

I suggest pulling these lines out into the main() of your program:

	// Fetch new store.
	store, err := crdbstore.NewCrDBStore("postgres://user:password@127.0.0.1:5432/database?sslmode=verify-full", []byte("secret-key"))
	if err != nil {
		log.Fatalf(err.Error())
	}
	defer store.Close()

	// Run a background goroutine to clean up expired sessions from the database.
	defer store.StopCleanup(store.Cleanup(time.Minute * 5))

@elithrar elithrar self-assigned this Jul 13, 2020
@stephenafamo
Copy link
Contributor Author

Thanks for pointing that out.

I've updated the example accordingly.

@elithrar elithrar merged commit 947297c into gorilla:master Jul 13, 2020
@elithrar
Copy link
Contributor

Merged, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants