Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optionally emit created for existing files on start up #1010

Open
davetapley opened this issue Oct 2, 2023 · 1 comment
Open

Optionally emit created for existing files on start up #1010

davetapley opened this issue Oct 2, 2023 · 1 comment

Comments

@davetapley
Copy link

It looks like there's some existing appetite for such a feature:

My use case:

I have APScheduler jobs defined in files, and the callback to get the job started is the same whether the file is present at start up or created later. So it would simplify things if Watchdog could emit an on_created for files present on startup, and my code didn't need to care whether the file was present at start up or created afterwards.

@Dimagog
Copy link

Dimagog commented Aug 2, 2024

+1, especially given that all workarounds suggested above suffer from race conditions:

  1. If you call observer.schedule before listing the dir then you may get 2 notifications for the same file created in between the calls.
  2. If you list the dir and then call observer.schedule, then you may miss a notification for a file that was deleted and re-created in between the calls.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants