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

Make appending to files transactional #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

itsthejb
Copy link

@itsthejb itsthejb commented Dec 7, 2019

Hi,

I use php-sane along with https://www.mayan-edms.com/ to scan documents, using the watch folder feature.

I encountered the problem that, when scanning multi-page (appended) documents, it's very possible that Mayan will pick up a partially completed document, and also delete the source. This is because php-sane appends to the document in the output folder.

So, in order to fix this, I've changed this so that instead of scanning final documents into the output directory, it instead scans and appends into the tmp directory. Then, when the user stops appending files the compiled file is moved to the output directory.

This means that multi-page documents are "transactional", so to speak.

Not the prettiest implementation, but it works!

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

Successfully merging this pull request may close these issues.

1 participant