Skip to content
This repository has been archived by the owner on Feb 16, 2023. It is now read-only.

config option for setting delay waiting for modified files while using inotify #1572

Closed

Conversation

s4nf4n
Copy link

@s4nf4n s4nf4n commented Jan 23, 2022

I bought a Canon GX7050 last year and setup paperless-ng shortly after.
It has Duplex ADF but behaves a little weird, when scanning multiple pages at once:

  • After scanning a page it closes the file and opens it again to write the next page.
  • Closing the file corresponds to inotify event IN_CLOSE_WRITE, which triggers consumption in paperless
  • Between closing and opening file again it takes between 200ms to 4s for the scanner to open the file again

I did not want to move to polling, as this still could poll just in the right moment when the file is between pages.

So with this feature I extended the consumer to wait for the file to remain unmodified for a configurable time CONSUMER_INOTIFY_WAIT_MODIFIED_DELAY after IN_CLOSE_WRITE event by starting a new inofify watch.
This defaults to 100ms, because new tests failed with github actions, when set lower. Actually this could be lowered for normal consumption but still kind of makes the consumption more robust.

For my use case I would raise this option to about 5s.

- consuming multiple files
- default wait time 100ms
- tests for consumable files, that get modified again
- further tests for consuming with delay
@s4nf4n
Copy link
Author

s4nf4n commented Feb 15, 2022

I am sorry but I just discovered now, that this solution has problems mit Files being moved to the consumption folder. I am closing this pull request and open a new one when I have figured this out.

@s4nf4n s4nf4n closed this Feb 15, 2022
@qcasey
Copy link

qcasey commented Feb 22, 2022

Hi @s4nf4n, this repo appears to be abandoned. I'd encourage you to open your PR in the Paperless revival project, paperless-ngx.

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

Successfully merging this pull request may close these issues.

None yet

2 participants