maplibre / martin

Blazing fast and lightweight PostGIS, MBtiles and PMtiles tile server, tile generation, and mbtiles tooling.
https://martin.maplibre.org
Apache License 2.0
2.33k stars 216 forks source link

Added validate function to PgConfig and invoked it in finalize and pool initialization #1546

Closed Saru2003 closed 1 month ago

Saru2003 commented 1 month ago

This PR addresses issue #1542, which states that the PostgreSQL pool size should not be allowed to be set to less than 1.

Changes:

  1. Introduced a validate method in the PgConfig struct to check the following:
  1. Updated the finalize and resolve methods to call the validate method. This ensures that the configuration is validated before proceeding with further processing.

  2. Updated pool.rs, ensures the validation process is integrated when creating a new pool by calling the validate method from the PgConfig instance.

Please review my implementation and provide feedback.

Saru2003 commented 1 month ago

@nyurik Kindly refer to the latest commit I have made.

Saru2003 commented 1 month ago

@nyurik Thanks for merging! Could you please add the "hacktoberfest-accepted" label? Thanks for considering!

CommanderStorm commented 1 month ago

@Saru2003 adding labels is only nessesary if a PR is not accepted via an approving review or merged.

nyurik commented 1 month ago

i'm a bit confused - what labeling are you talking about? We only add labels relevant to the Martin project, e.g. which subsystem the PR applies to, or things like "help needed", etc.