Closed scott1702 closed 3 years ago
Huh, I think I've been burnt by this in other projects 😅
Does this prevent the job being created initially, but will run in the queue? Or does it "fail" if you don't pass in $indexName
so you are forced to pass it in?
I can confirm this works as expected. The issue was that when queuedjobs
instantiates the job internally it doesn't pass any arguments. However, the job descriptor which is actually run still has all the details (e.g. the index name), so data gets cleared from the correct index.
I'm happy merging this despite codecov packing a sad, there's no point testing the if(!$indexName)
line
QueuedJobs requires default values to be set in __construct which causes this job to be stuck in "Initialising" https://github.com/symbiote/silverstripe-queuedjobs/blob/89a057ce2c7e2f9560b8eea6d1974f423f45dc8b/docs/en/defining-jobs.md#api-overview