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

[4.x] Upgrading from Craft 3 creates resaving batch jobs twice #94

Closed
gddotorg opened this issue Sep 15, 2023 · 1 comment
Closed

[4.x] Upgrading from Craft 3 creates resaving batch jobs twice #94

gddotorg opened this issue Sep 15, 2023 · 1 comment
Labels

Comments

@gddotorg
Copy link

Description

We are currently upgrading Craft from version 3 to version 4 for one of our clients. We have carried out a test run and found that the resaving batch job is being carried out several times. So "(batch 1 of ...)" is executed twice in the queue. Our issue is that we have about 48,000 digital products and therefore about 480 batch jobs and this is two times. Brief background: We had overall performance issues after the update and I am in the process of reducing the queue jobs overall. Therefore my questions: How can I prevent that each batch is executed twice or is it necessary? Can I prevent a resave job from being generated automatically? If so, we could just trigger the bulk job manually if the load on the server is not too big.

I guess this is the function, which is triggered twice: https://github.com/craftcms/digital-products/blob/3.0/src/Plugin.php#L214

Additional info

  • Craft version: 4.5.4
  • Commerce version: 4.2.11
  • PHP version: 8.1.21
  • Database driver & version: MariaDB 10.5.19
  • Plugins & versions:

Asset Rev 7.0.0
Blitz 4.5.3
CP Field Inspect 1.4.4
Digital Products 3.2.3
Elasticsearch 2.1.1
Element API 3.0.1.1
Empty Coalesce 4.0.0
Feed Me 5.2.0
Field Manager 3.0.7
Formie 2.0.36
ImageOptimize 4.0.5
Imager X 4.2.2
Redactor 3.0.4
Retour 4.1.13
Sentry SDK 2.0.1
SEOmatic 4.0.31
Sprig 2.6.2
Super Table 3.0.9
Vite 4.0.6
Wishlist 2.0.6

@gddotorg gddotorg added the bug label Sep 15, 2023
@gddotorg
Copy link
Author

gddotorg commented Oct 4, 2023

I have now found out myself how to cancel at least the second run of saving the products. In the resave function I have seen that at the end of the execution process the new batch job is created. This means that if I delete the batch job, which is not yet executed, from the queue, no new batch job is created. Consequently, I can delete one of the two "(batch 1 of ...)" jobs and then only one will run. jobs and then only one will continue to run.

@gddotorg gddotorg closed this as completed Oct 4, 2023
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