Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I would like to expose apachesolr_cron to drush so I can control the rate of indexing myself, rather than just delegating that to the batch functions.
Comment | File | Size | Author |
---|---|---|---|
#7 | 1836262-7.patch | 5.34 KB | Nick_vh |
#3 | apachesolr-1836262-cron-limit-3.patch | 5.4 KB | ianthomas_uk |
#2 | apachesolr-1836262-cron-limit-1.patch | 5.11 KB | ianthomas_uk |
Comments
Comment #1
ianthomas_ukFollowing discussion with nick_vh on IRC I have decided to implement this as an option for the existing drush solr-index command, rather than calling apachesolr_cron.
The attached patch also adds environment-id options to the solr-index, solr-delete-index and solr-mark-all commands
Comment #2
ianthomas_ukThe ATTACHED patch...
Comment #3
ianthomas_ukThe earlier patch was missing the extra parameter for apachesolr_index_batch_index_remaining
Comment #4
Nick_vhSuper useful
Minor comment but critical enough
breaking api?
Comment #5
ianthomas_ukGood point, I'll look in to that. IIRC $context is added automatically by the batch API, so I can't just add $total_limit it as a third parameter.
Is it OK to change that function signature so long as old code using the batch API still works? (i.e. is the function itself considered part of the API, or only the exposure via batch API)
Comment #6
Nick_vhyeah, as long as old code still works I'd be happy :)
Comment #7
Nick_vhHmm, I did some searches and the only contrib module that needs altering is apachesolr_parallel
I would even be ok in changing this function as I expect almost no-one to alter the batch process, rather writing their own.
Comment #8
Nick_vhRTBC
Comment #9
Nick_vhCommitted to 7.x-1.x, should commit to 6.x-3.x
Comment #10
pwolanin CreditAttribution: pwolanin commented