Hi. tortoise orm is rasing configuration error inside taskiq. #440
KAMRON-DEVELOPER
started this conversation in
General
Replies: 3 comments 2 replies
-
Can you share more info? How do you initialize database? What do you do on startup events? |
Beta Was this translation helpful? Give feedback.
2 replies
-
Hi. I left a comment on github. Thank you.
…On Mon, Apr 7, 2025 at 7:42 PM Pavel Kirilin ***@***.***> wrote:
Can you share more info? How do you initialize database? What do you do on
startup events?
—
Reply to this email directly, view it on GitHub
<#440 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A4RA73LESKWYSNQ2N5WUDA32YKFFFAVCNFSM6AAAAAB2ROPJF2VHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTENZVGIZTMOI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Ok, I understand.
…On Wed, Apr 9, 2025 at 11:25 PM Pavel Kirilin ***@***.***> wrote:
No you cannot. Because worker doesn't have an app and therefore doesn't
have any client connections. Your web application can have connections,
which should be handled on the app side only.
Since you send messages over redis, only data that you send to your worker
can be accessible from tasks.
—
Reply to this email directly, view it on GitHub
<#440 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A4RA73OJE5BJTLGLHN5TXS32YVQZ5AVCNFSM6AAAAAB2ROPJF2VHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTENZYGIZDCNY>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
my_taskiq.py
@broker.task()
async def distribute_restore_tasks(target: str):
batch_size = 1000
assert target in {"redis", "db"}, ValueError("Target must be either 'redis' or 'db'")
my_logger.debug(f"Starting distribute_restore_tasks with target: {target}")
async def distribute_tasks_for_model(model: type[Model], pattern: str, target: str, batch_size: int):
db = Tortoise.get_connection("default")
console where taskiq worker is running
raise ConfigurationError(
tortoise.exceptions.ConfigurationError: default_connection for the model <class 'app.users_app.models.UserModel'> cannot be None
Beta Was this translation helpful? Give feedback.
All reactions