Add time limit option to search-api:index

Created on 18 June 2025, 6 days ago

Problem/Motivation

There is already a --limit option on the search-api:index drush command, but that does not take time into account.

In some scenarios, e.g. a worker running the drush command, having a clean time out would be nice to have, since the limit passed may not always index at the same pace.

Steps to reproduce

N.A.

Proposed resolution

Introduce a new --time-limit option to the command.

Remaining tasks

- Open the MR.
- Code review.

Feature request
Status

Active

Version

1.0

Component

Drush / Rules

Created by

🇵🇪Peru marvil07

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @marvil07
  • 🇵🇪Peru marvil07

    Over MR 244 the new option is introduced.

    From the commit message:

    This time limit is a best effort, not a exact time out.
    Given the underlying code uses Batch API to run the indexing, a more exact bail out is not truly possible.
    Instead, do check after each batch is processed, and act accordingly.

    Sample use:

    drush search-api:index --time-limit=30 node_index
    
  • Pipeline finished with Failed
    6 days ago
    Total: 539s
    #524821
  • Pipeline finished with Success
    5 days ago
    Total: 533s
    #525834
Production build 0.71.5 2024