alleyinteractive / wp-bulk-task

A library to assist with running performant bulk tasks against WordPress database objects.
GNU General Public License v2.0
13 stars 0 forks source link

Cursor option should not autoload #13

Closed dlh01 closed 7 months ago

dlh01 commented 7 months ago

Description of the bug

The option saved by Cursor does not specify an $autoload parameter, and is therefore autoloaded, but I can't think of any reason why it should be.

Steps To Reproduce

  1. Run a bulk task.
  2. Observe that the bt_{$task} option is has an autoload of yes.

Additional Information

No response

renatonascalves commented 7 months ago

I don't either. But I don't think this is a bug since this option would only be harmfull if it was large in size.

dlh01 commented 7 months ago

True, the option is not large, but what if you have 50 bulk tasks? That's 50 additional rows to be pulled by the autoload database query. If you run a couple of tasks with a dynamic key — for example, if the key is based on a category ID — it seems quite possible that you would end up with an even larger number of cursors in the database.

renatonascalves commented 7 months ago

Agree! I plan on fixing this soon. I agree it is a problem, I just don't agree it is a bug, yet. =P