diff options
| author | Vosjedev <vosje@vosjedev.net> | 2025-11-06 15:31:10 +0100 |
|---|---|---|
| committer | Vosjedev <vosje@vosjedev.net> | 2025-11-06 15:31:10 +0100 |
| commit | 5587eba968975448b13fcde73cc6926c89865248 (patch) | |
| tree | fff9428c02b049764d048318076cead51276628a | |
| parent | 09bd88897c4d766727d33dbd9b81d9d5a82eae59 (diff) | |
| download | acit-5587eba968975448b13fcde73cc6926c89865248.tar.gz acit-5587eba968975448b13fcde73cc6926c89865248.tar.bz2 acit-5587eba968975448b13fcde73cc6926c89865248.tar.xz | |
Properly handle ports being passed for db
| -rw-r--r-- | src/acit/db.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/acit/db.py b/src/acit/db.py index 99ba50d..13cecde 100644 --- a/src/acit/db.py +++ b/src/acit/db.py @@ -29,6 +29,11 @@ class DBPoolManager(plugins.SimplePlugin): HOST=os.getenv("MYSQL_HOST","database") if ":" in HOST: HOST,PORT=HOST.split(":",2) + try: + PORT=int(PORT) + except ValueError: + self._log("Invalid port number, using 3306") + PORT=3306 else: PORT=3306 |
