Manual Trigger Next Batch Creation
-
Hello
I am wondering if there is a way to manually trigger the next batch creation using the cron as I am sick and tired of dealing with the frozen feed updates.Sometimes it works great, many times it starts well and then hangs at 50% or 60%
I have tried lowering the batch size up to 100 and still the same, it works very randomlyI have noticed that in the cron schedule the following is added.
Is this the one that triggers the next batch ?
https://ibb.co/p0m1Tjbif not is there a cron event I can create to run and trigger the next batch when the process hangs ?
Thank you
- This topic was modified 3 years, 7 months ago by raffi007.
-
https://ibb.co/p0m1Tjb is the cron hook that runs after the processing of your feed is done and it counts the number of products in your feed.
batch hooks look like this:
https://www.dropbox.com/s/ny0k61wtgaifdwj/batch_hooks.png?dl=0and only when there is no such batch hook present you can also run this one:
https://www.dropbox.com/s/g8sc3pqp5tjjgbs/cron-hook.png?dl=0So if I understand well the process is the following
After I press on manual update the following happens
1- The update process is ran and when the the batch size is reached then
2- https://ibb.co/p0m1Tjb counts the number of products in the feed and displays the % on the Manage feed page then
3- Batch hook is created in the Cron to trigger the next Batch, when the batch is created
Points #2 & #3 are repeated until all products are added to the feed ?
So if the feed update hangs, all I have to do is manually create/run the Batch hook and then the Cron Hook
No, you can completely ignore this cron hook: https://ibb.co/p0m1Tjb
It is only meant to update graphs.Once an update of the feed starts, either by a manual trigger or automated trigger (woosea_cron_hook) the plugin processes the first batch of products. Once the first is done it creates the follow-up woosea_create_batch_event which in its turn starts processing the next batch of products. This process of creating new woosea_create_batch_event(s) keeps going all the way till all products are processed.
So when the feed hangs you do indeed need to “push” the hanging/idle woosea_create_batch_event hook and one there really isn’t such a hook push the oosea_cron_hook
I tried it, in appearance it worked but when i checked the feed file created, it only had 5000 lines where the normal file should have around 68000
But everytime i triggered the woosea_create_batch_event the % on the Manage Feed page increased.So basically from what i can conclude is that the let us say i have a batch number of 400, when i am triggering the manual update of the feed, the plugin is starting to generate the file but hangs lets say at 100 products and doesnt continue doing the rest of the 300, and then when manually i trigger woosea_create_batch_event again, it creates again another 100 products out of 400 etc etc
So basically something is preventing the full batch from processing that is exctly why i don’t even see woosea_create_batch_event automatically added to the cron events, it is because the batch is never finishing from processing.This is the cae even if I make the batch size 100 products, so there is something wrong with the plugin.
For sure my server can manage 100 products per batch.Any suggestions ?
No that is not correct. The plugin checks the state the batches are in and the amount of products it has processed. When it reaches the processing status “ready”(which from your reply I assume it does) then it really went true all of your products.
Anyhow, when you expect to get 68.000 products in your feed and you are using a batch size of 400 you had to manually trigger the cron hook 170 times. I don’t think that is correct as according to your debug.log you shared earlier there are 5583 products in your WooCommerce store?
I didnt mean 68000 products, i meant 68000 lines in the xml file
when I manually triggered the the woosea_create_batch_event
the xml file only had 5000 lines instead of 68000 meaning not all products have been addedAssuming it is this feed:
https://www.citystationerygroup.com/wp-content/uploads/woo-product-feed-pro/xml/lKf9IDCCQqXdpZ3aaXTqdrHqgleUE5Zv.xmlIt has 400 products in it, which is exactly one batch. So it never processed any batches it seems.
- This reply was modified 3 years, 7 months ago by supportadtribes.
I just finished manually processing a feed refresh using the woosea_create_batch_event
I have set the Batch size to 100 and i have manually triggered the batch event 50 times since each time 2% was added on the completion % on the Manage my feed.
The final file generated contained this time only 1338 lines.
So basically manually triggering the woosea_create_batch_event is not working in creating a correct feed file
What could be preventing the batch from finishing ?
even at a batch of 100 the process hangs- This reply was modified 3 years, 7 months ago by raffi007.
The amount of lines in a XML file is meaningless. The file you created has 4612 products in it which is roughly the same with all other updates of the last couple of weeks that took place.
See the history:
[19 Feb 2021 21:38] => 4598 [22 Feb 2021 14:39] => 4607 [24 Feb 2021 14:26] => 4607 [02 Mar 2021 16:56] => 4607 [06 Mar 2021 02:08] => 4607 [06 Mar 2021 10:53] => 4607 [10 Mar 2021 17:14] => 4625 [13 Mar 2021 11:54] => 4630 [13 Mar 2021 13:16] => 4630 [13 Mar 2021 19:26] => 4630 [16 Mar 2021 11:23] => 4615 [17 Mar 2021 17:24] => 4616 [19 Mar 2021 15:27] => 4616 [23 Mar 2021 07:43] => 4616 [25 Mar 2021 15:24] => 4616 [29 Mar 2021 17:31] => 4617 [29 Mar 2021 17:33] => 4617 [29 Mar 2021 18:45] => 4617 [01 Apr 2021 13:24] => 4610 [02 Apr 2021 10:59] => 4610 [03 Apr 2021 14:50] => 4610 [04 Apr 2021 17:09] => 4609 [04 Apr 2021 18:35] => 4610 [04 Apr 2021 19:34] => 4610 [04 Apr 2021 20:20] => 4610 [04 Apr 2021 21:15] => 4610 [05 Apr 2021 07:47] => 4610 [05 Apr 2021 19:44] => 4610 [06 Apr 2021 07:35] => 4610 [06 Apr 2021 08:23] => 4610 [06 Apr 2021 15:40] => 4610 [10 Apr 2021 23:44] => 4610 [11 Apr 2021 12:34] => 4612 [11 Apr 2021 17:33] => 4612
So manually processing, like you did now seems to bring the same result as the automated updates. If I were you I would just leave the batch size on 300 to 400.
The reason your feed does not update automatically seems to be because you have set the refresh interval to “no refresh”, see:
[cron] => no refresh
- This reply was modified 3 years, 7 months ago by supportadtribes.
What I did is that I changed once again the batch number to 700 and refreshed the feed manually and it automatically generated the feed successfully and the output file had all the products 4612. but when i did the manual trigger it only generated 400 products.
i was just trying to find a manual solution to the problem of getting the feed stuck when refreshing and it seems i couldn’t get it to work by manually triggering the woosea_create_batch_event
BTW a very weird thing i noticed.
Remember the last problem I was having where 24 duplicate products were being generated and I posted about it.
Back then the solution I had found was to change the Batch number from 500 to 400 and manually refreshed the feed and it worked and the 4612 products were accepted by facebook without any duplicates being rejected.While testing today the feed being stuck, at one point I set the batch number to 500 and when I generated the feed, the exact same 24 duplicates came back and were rejected by Facebook.
So apparently there is a correlation between the batch number and how duplicates are being created by the plugin.
As soon as I changed the batch number to 700 and refreshed the feed, the duplicates disappeared and facebook accepted all the products.
Maybe there is something to check on your end on why this scenario is happening and it can be reproduced as soon as the batch number is set to 500
- The topic ‘Manual Trigger Next Batch Creation’ is closed to new replies.