fix(db): 🔧 Update pool size configurations.
This commit is contained in:
@@ -9,7 +9,7 @@ from discord import errors
|
||||
from discord.ext import commands, tasks
|
||||
from discord.utils import find
|
||||
|
||||
from tortoise import transactions
|
||||
from tortoise import transactions, exceptions
|
||||
|
||||
import asyncpg.exceptions
|
||||
|
||||
@@ -648,7 +648,14 @@ class Calls(base.Cog):
|
||||
|
||||
channel = await utils.get_channel(message.channel)
|
||||
|
||||
call = await models.Call.get(id=channel.call_id).prefetch_related("channels")
|
||||
try:
|
||||
call = await models.Call.get(id=channel.call_id).prefetch_related(
|
||||
"channels"
|
||||
)
|
||||
|
||||
except exceptions.DoesNotExist:
|
||||
await self.bot.redis.srem(constants.CHANNELS_ONCALL_SET, str(channel_id))
|
||||
return
|
||||
|
||||
other_channel: models.Channel = find(
|
||||
lambda c: c.id != channel_id, call.channels
|
||||
|
||||
+13
-3
@@ -1,6 +1,7 @@
|
||||
import os
|
||||
|
||||
from dotenv import load_dotenv
|
||||
|
||||
load_dotenv()
|
||||
|
||||
|
||||
@@ -10,7 +11,18 @@ IS_DEBUG = os.environ.get("IS_DEBUG", "false") == "true"
|
||||
|
||||
TORTOISE_ORM = {
|
||||
"connections": {
|
||||
"default": f"postgres://payphone:payphone@{"localhost" if IS_DEBUG else "database"}/payphone",
|
||||
"default": {
|
||||
"engine": "tortoise.backends.asyncpg",
|
||||
"credentials": {
|
||||
"host": "localhost" if IS_DEBUG else "database",
|
||||
"port": "5432",
|
||||
"user": "payphone",
|
||||
"password": "payphone",
|
||||
"database": "payphone",
|
||||
},
|
||||
"minsize": 5,
|
||||
"maxsize": 1000,
|
||||
},
|
||||
},
|
||||
"apps": {
|
||||
"models": {
|
||||
@@ -18,8 +30,6 @@ TORTOISE_ORM = {
|
||||
"default_connection": "default",
|
||||
}
|
||||
},
|
||||
"minsize": 5,
|
||||
"maxsize": 1000
|
||||
}
|
||||
|
||||
SUGGESTIONS_CHANNEL_ID = int(os.getenv("SUGGESTIONS_CHANNEL_ID"))
|
||||
|
||||
Reference in New Issue
Block a user