-
Notifications
You must be signed in to change notification settings - Fork 394
No need to have version_string
as an argument since it's always the same
#19012
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
No need to have version_string
as an argument since it's always the same
#19012
Conversation
Keywords make it easier to search and positional arguments are easy to mess up especially when there are multiple strings next to each other.
version_string: A string to present for the Server header | ||
max_request_body_size: TODO | ||
context_factory: TODO | ||
reactor: TODO |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are future TODO's (not for this PR)
|
||
def __init__( | ||
self, | ||
*, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made these keyword only arguments to make it easier to search and confirm what server_version_string
was used for.
Additionally, a good idea because positional arguments are easy to mess up especially when there are multiple strings next to each other.
self._instance_name = config.worker.instance_name | ||
|
||
self.version_string = version_string | ||
self.version_string = f"Synapse/{SYNAPSE_VERSION}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main change is consolidating everything to this assignment instead of this being passed in as an argument.
Conflicts: synapse/app/homeserver.py
Thanks for the review @anoadragon453 🦝 |
No need to have
version_string
as an argument since it's always the same.Assuming, we're happy with #19011, this PR makes sense. But we should leave the decision and context of having them be the same to that PR first.
Pull Request Checklist
EventStore
toEventWorkerStore
.".code blocks
.