Skip to content

--live-reload reloads on changes of database file #501

@SmithChart

Description

@SmithChart

Well, I've tested --live-reload on my current project. And I think I mostly like this feature :-) It mostly works as expected.

But: I am using a sqlite3 database (with the Django ORM). This means every change made to the database will lead to an updated file inside my project repository. And this leads to Lona reloading.
Looking at the implementation it's totally clear why this happens.

But I think we could exclude a few extensions from the watch without loosing anything.
watchfiles has filters in place: https://watchfiles.helpmanual.io/api/filters/#watchfiles.filters.DefaultFilter.ignore_entity_patterns
I would suggest to add a DefaultFilter to watchfiles.run_process(). And to add at least .sqlite3 to the ignore_entity_patterns list. If we keep our extensions to the filter list at a central place we could event update this list if new extensions come along that we do not want to watch.

What do you think about this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions