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

Replace --disable-clean with --enable-clean. #2305

Merged
merged 3 commits into from
Sep 24, 2017

Conversation

sebastienvercammen
Copy link
Member

Description

Reverse the behavior for the config item of the background database cleaner.

Motivation and Context

The DB cleaner should only be enabled on one instance, which fits better with -DC, --enable-clean. Too many people skipped --disable-clean, enabling the DB cleaner on all their instances and inevitably running into MySQL deadlocks.

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@@ -389,7 +389,7 @@ def get_args():
help=('Get all details about gyms (causes an ' +
'additional API hit for every gym).'),
action='store_true', default=False)
parser.add_argument('--disable-clean', help='Disable clean db loop.',
parser.add_argument('-DC', '--enable-clean', help='Enable DB cleaner.',
Copy link
Contributor

Choose a reason for hiding this comment

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

-DC for --enable-clean seems confusing (is it meant to be short for "DB Cleaner"?)

Copy link
Contributor

Choose a reason for hiding this comment

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

+1 and caps are also weird

Copy link
Member Author

@sebastienvercammen sebastienvercammen Sep 22, 2017

Choose a reason for hiding this comment

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

@michikrug @friscoMad Correct, -D is used for the database (although currently sqlite). -DC is short for the DB's cleaner. Caps aren't weird, they're common for differences in behavior.

If they're confusing you because you're reading the short and long form together, consider the contexts of their use cases: you're setting cli args, you think of -D for the database and also remember you want to enable the cleaner, so -DC will be easy to remember. For more detailed configuration in the config file, you have the clean long form --enable-clean.

We currently only have long forms for database info (e.g. --db-host) which could get a short form by extending the -D argument: -DH for host (and we have -H for web host), -DP for port, and so on.

For the future, this is what we're going for. It avoids absurd and arbitrary short forms - pxo, ldur, wwhtf, ...

Copy link
Member

@FrostTheFox FrostTheFox Sep 22, 2017

Choose a reason for hiding this comment

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

I don't see a problem. -DatabaseCleaner -> -DC. Especially if we're considering extending the database args like that for -DH, -DP, etc. Prefixing arguments generally makes sense and should allow people to make educated guesses. (Oh, I need to change something in the database... -D... and I need to change the port... P... -DP...)

Copy link
Contributor

@friscoMad friscoMad Sep 24, 2017

Choose a reason for hiding this comment

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

I found it confusing as we already have -dc and because the previous behaviour was --disable-clean so -DC also seems to be a shorthand of it, and I do not see a problem to use D as a prefix for all database options or P for proxies but in that case -Dec and --db-enable-clean seems a better fit for me or if we prefrer a shorter version -Dc and --db-clean

Copy link
Contributor

@KartulUdus KartulUdus left a comment

Choose a reason for hiding this comment

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

don't see a problem with naming.
It's a nice addition as it's optimal to run this on one instance.

@sebastienvercammen sebastienvercammen merged commit 758fb60 into RocketMap:develop Sep 24, 2017
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

5 participants