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

Various cleanups #35

Merged
merged 2 commits into from
May 15, 2017
Merged

Various cleanups #35

merged 2 commits into from
May 15, 2017

Conversation

mjs
Copy link

@mjs mjs commented May 14, 2017

Pass CleanAndPrune arguments as a struct

In preparation for adding more.


Avoid unnecessarily passing db around

The pruning related functions often took both a mgo.Collection and a
mgo.Database. This was unnecessary given that the database can be
retrieved from the collection. It is also safer to pass them together
given that the collection's database should never be different to the
given database.

Menno Smits added 2 commits May 11, 2017 11:03
In preparation for adding more.
The pruning related functions often took both a mgo.Collection and a
mgo.Database. This was unnecessary given that the database can be
retrieved from the collection. It is also safer to pass them together
given that the collection's database should never be different to the
given database.
Copy link
Member

@jameinel jameinel left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -286,10 +311,11 @@ func txnsPruneC(txnsName string) string {
// TODO(mjs) - this knows way too much about mgo/txn's internals and
// with a bit of luck something like this will one day be part of
// mgo/txn.
func PruneTxns(db *mgo.Database, oracle Oracle, txns *mgo.Collection, stats *CleanupStats) error {
func PruneTxns(oracle Oracle, txns *mgo.Collection, stats *CleanupStats) error {
Copy link
Member

Choose a reason for hiding this comment

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

Do we want to unexport this in preparation for the future?

Copy link
Author

Choose a reason for hiding this comment

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

we can do this later

@mjs mjs merged commit 8359c45 into juju:master May 15, 2017
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