Skip to content

Conversation

mertemr
Copy link

@mertemr mertemr commented Jun 14, 2025

Introduced a new setting MJML_TCPSERVERS_RANDOM and MJML_HTTPSERVERS_RANDOM for server selection, allowing random server selection to be toggled. This makes it possible to either use the servers in order or randomly.

  • Both settings default to True, enabling random selection by default, but can be set to False to maintain a fixed order of servers.

  • Refactored the mjml/tools.py file to shuffle the servers list based on the new settings for both TCP and HTTP backends.

@liminspace
Copy link
Owner

@mertemr thank you for your involvement, but you are wrong with main logic of using multiple servers: there is no using servers in order, next server will be used only if previous failed. So that is why the list of server is shufled.
By the way, I'm going to refactor this app to make it more flexible and easier to extend. I think next months I will find some time to do that.

@mertemr
Copy link
Author

mertemr commented Jun 15, 2025

@liminspace I realized what you meant while testing after I opened the pull request. If you'd like, I'd be happy to contribute to this issue.

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