Skip to content

Commit 36f4ca9

Browse files
committed
chore: 3.6.1
1 parent 061cf35 commit 36f4ca9

File tree

4 files changed

+15
-4
lines changed

4 files changed

+15
-4
lines changed

.github/CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
> previously functions and constants are all over the place that it's starting
77
> to get harder to find what I'm looking for.
88
9+
## 3.6.1 (Project Structure Refactor - Part 1.5 A.K.A Hotfix)
10+
11+
- [**Fixed**] Fixed issues related to `import tse`
12+
- [**Fixed**] Aerich caused the bot to crash in production environment
13+
914
## 3.6.0 (Project Structure Refactor - Part 1)
1015

1116
### Bugfixes

aerichConfig.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@
1010
except ImportError:
1111
dbUrl = os.environ["ZIBOT_DB_URL"]
1212

13-
cfg = Config("", dbUrl)
13+
cfg = Config("", dbUrl, useAerich=True)
1414
t = cfg.tortoiseConfig

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "Z3R0"
3-
version = "3.6.0"
3+
version = "3.6.1"
44
description = "A multi-purpose open source discord bot"
55
authors = ["null2264"]
66
license = "MPL-2.0"

src/main/core/config.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ class Config:
2525
"internalApiHost",
2626
"test",
2727
"zmqPorts",
28+
"useAerich",
2829
)
2930

3031
def __init__(
@@ -41,6 +42,7 @@ def __init__(
4142
internalApiHost: str | None = None,
4243
test: bool = False,
4344
zmqPorts: dict[str, int] | None = None,
45+
useAerich: bool = False,
4446
):
4547
self.token = token
4648
self.defaultPrefix = defaultPrefix or ">"
@@ -54,19 +56,23 @@ def __init__(
5456
self.internalApiHost = internalApiHost or "127.0.0.1:2264"
5557
self.test = test
5658
self.zmqPorts = zmqPorts or {}
59+
self.useAerich = useAerich
5760

5861
@property
5962
def tortoiseConfig(self):
6063
mainModel = "main.core.db"
6164
if not self.test:
6265
mainModel = "src." + mainModel
6366

67+
models = [mainModel]
68+
if self.useAerich:
69+
models.append("aerich.models")
70+
6471
return self._tortoiseConfig or {
6572
"connections": {"default": self.databaseUrl},
6673
"apps": {
6774
"models": {
68-
# "models": [mainModel, "aerich.models"],
69-
"models": [mainModel],
75+
"models": models,
7076
"default_connection": "default",
7177
},
7278
},

0 commit comments

Comments
 (0)