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

Textract runs when document file hasn't updated #7

Open
kaedroho opened this issue May 3, 2018 · 5 comments
Open

Textract runs when document file hasn't updated #7

kaedroho opened this issue May 3, 2018 · 5 comments

Comments

@kaedroho
Copy link

kaedroho commented May 3, 2018

Currently, it appears there's no check for whether the file has actually changed before rerunning textract so it probably reruns even if the user has only updated the title.

@gasman and I were discussing adding file hashing to Wagtail Images/Documents for cache-busting but might help solve this issue too.

@khink
Copy link
Contributor

khink commented May 4, 2018

You are right, it always runs, even if only title/tags were changed. No way to tell in save() what was updated, so yes, a hash would come in handy.

@allcaps
Copy link
Member

allcaps commented May 8, 2018

Maybe you can query the current object in save method and inspect if the file field has changed.
https://stackoverflow.com/questions/12461100/django-detecting-changed-imagefield-with-same-filename

@khink
Copy link
Contributor

khink commented Jun 5, 2018

@kaedroho Is there an issue in Wagtail for file hashing, is it likely that it'll be in wagtail some time soon?

@kaedroho
Copy link
Author

kaedroho commented Jun 5, 2018

Yep, there's a PR here: wagtail/wagtail#4526

@zerolab
Copy link

zerolab commented Oct 31, 2018

The document file hash will make it in Wagtail 2.4. So this could probably be looked at with the latest Wagtail master

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

4 participants