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

Dynamicly adjusting rust_timeout #328

Open
stumpylog opened this issue Jan 14, 2025 · 0 comments
Open

Dynamicly adjusting rust_timeout #328

stumpylog opened this issue Jan 14, 2025 · 0 comments
Labels

Comments

@stumpylog
Copy link

Description

I'm prototyping porting some code to watchfiles from inotify-simple which needs to wait until some X seconds have passed since an event against a file before taking action with that file.

I'm unsure how I can accomplish something similar with watchfiles. I think it would need changing rust_timeout in some dynamic way, to either 0 if no files are waiting or the max event time if files are waiting so they can be checked and potentially processed.

Is this possible? Is there a way to accomplish something like this, ideally without stopping the watching to do so?

PS: I would have made this a discussion, since it is clearly more just a question. Maybe consider opening those for the repo?

Example Code

The existing code I am evaluating transitioning:

https://github.com/paperless-ngx/paperless-ngx/blob/ab87aedfc75cb5072e31ce43253224d727e97771/src/documents/management/commands/document_consumer.py#L286-L359

Watchfiles Output

No response

Operating System & Architecture

x86_64

Environment

No response

Python & Watchfiles Version

3.11

Rust & Cargo Version

No response

@stumpylog stumpylog added the bug label Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant