I am migrating some nodes from an API.
The API only accepts 60 requests per minute.
So it means if 60 items are imported in a minute, all other items will not be imported because the API will return 429 error code in that case.
So on the next cron, the same 60 items will be processed and will be updated. All the other items will never be imported.
function mymodule_cron() { /** @var DrupalmigratePluginMigrationInterface $migration */ $migration = $this->migrationPluginManager->createInstance($migration_id); $migration->getIdMap()->prepareUpdate(); $executable = new MigrateExecutable($migration, new MigrateMessage()); $executable->import(); }
So what should I do in this case to import all the items?
Is there any queue functionality with the cron which executes migration? So that I can tell to execute 60 items per queue and execute one queue per minute, something like that?