← 输入框|github.com|刷新
Skip to content

Hot reload triggers on database change #110

Closed

Description

@tyleralbee

When starting a worker using the CLI with hot reload enabled:

taskiq worker my_app.broker:broker -r

It's noted in the docs that hot reload should take into account .gitignore:

Also this option supports .gitignore files. If you have such file in your directory, it won't reload worker when you modify ignored files.

I'm using sqlite3 in development, and it's in my .gitignore here:

# SQLite database
*.sqlite3

However, when I make changes to the database, it causes the worker to reload.

Here's my dependency tree relevant to the issue:

taskiq-redis==0.3.0
  redis==4.4.2
    async-timeout==4.0.2
  taskiq==0.4.0
    importlib-metadata==6.4.1
      zipp==3.15.0
    pycron==3.0.0
    pydantic==1.10.7
      typing_extensions==4.4.0
    taskiq-dependencies==1.1.2
    typing_extensions==4.4.0

I'm on Ubuntu 22.04 and this is a Django project that I'm working in.

Let me know if I'm doing something wrong or if this is a bug.

Edit: Wanted to add - generally, I've had a good experience with TaskIQ, and I appreciate the hard work on the project.

Activity

  1. s3rius commented on Apr 21, 2023

    @s3rius
    Member

    Hi, and thanks for raising this issue. I have a question. Do you start taskiq worker from the directory with .gitignore file? Because currently there's no way to configure custom gitignore paths.

    Maybe you want to change your gitignore contents to:

    **/*.sqlite3
    

    This way it's going to ignore all sqlite3 files. But I guess, we have to add explicit file ignores parameters. I will leave this issue open, until we implement new parameters to specify ignored files.

  2. tyleralbee commented on Apr 21, 2023

    @tyleralbee
    Author

    Thanks for the response. I'll give you a confirmation on this later tonight.

  3. tyleralbee commented on Apr 22, 2023

    @tyleralbee
    Author

    Just wanted to check back in and let you know that I did try changing my .gitignore, which now looks like this:

    # SQLite database
    **/*.sqlite3
    

    However, this did not solve the problem.

  4. s3rius commented on Apr 22, 2023

    @s3rius
    Member

    Hi, @tyleralbee, I was debugging into your problem and found out, that it was not a database. It's because of a temporary files that are created by sqlite. Please try again with these files to your .gitignore. They're created during the query execution. You can read about them here: https://www.sqlite.org/tempfiles.html.

    Here's a correct gitignore:

    *.sqlite3
    *.sqlite3-journal
  5. self-assigned this
    on Apr 22, 2023
  6. s3rius commented on Apr 22, 2023

    @s3rius
    Member

    If the problem is resolved, don't forget to close the issue.

    If you find your experience with task pleasant, you can help us improve by hitting the star button and giving us feedback here in the discussion.

  7. tyleralbee commented on Apr 23, 2023

    @tyleralbee
    Author

    I can confirm that this fixed the issue. Thanks @s3rius.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions