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

Add promise queueing to try and make batch operations faster #2690

Closed
wants to merge 8 commits into from

Conversation

AWare
Copy link
Contributor

@AWare AWare commented Dec 5, 2019

What does this change?

This will only allow two batch operations or image uploads to run concurrently. I've used this pattern a few times to fix similar problems so am hopeful it'll help things.

How can success be measured?

Increased performance when running batch jobs.

Screenshots (if applicable)

Who should look at this?

@akash1810 @paperboyo @mbarton
Could also do with a hand spinning up grid locally or on test to test this.

Tested?

  • locally
  • on TEST

@paperboyo
Copy link
Contributor

I’ll let Akash and Micheal have proper opinions, but just a quation from a village idiot: which batch operations does this apply to? Uploads? Metadata editing? Deletions? Only through UI or mediaAPI too?

@AWare
Copy link
Contributor Author

AWare commented Dec 5, 2019

Just in the UI, and afaict, all of the above as I changed the helper that appears used in all of those places. JS is very good at queuing a far larger number of promises concurrently than it's able to deliver on.

@paperboyo
Copy link
Contributor

Looking forward to test batch operations on TEST, then 👏 .

Copy link
Contributor

@mbarton mbarton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯 Great to get this in, definitely the next step after the original work to track batch operations

Not a huge fan of the linter-change-noise in the diff but LGTM

error.body && error.body.errorMessage || 'unknown';
const message =
reason === "unsupported-type"
? "The Grid only supports JPG and PNG images." +
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated but does this message need changing now TIFF support has been added? cc @paperboyo

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for review, @mbarton! Yeah, also seen it, but TIFF support hasn’t been advertised yet. Reasoning (not too strong, I admit) being outstanding work in this.

@AWare
Copy link
Contributor Author

AWare commented Dec 6, 2019

@mbarton yeah, sorry, not sure how to fix that :(

@AWare AWare closed this Feb 11, 2020
@AWare AWare mentioned this pull request Dec 21, 2020
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants