Zend certified PHP/Magento developer

Cron job hangs n ‘in process’ status

I have implemented a bridge between an external system and Magento, retrieving product details for the external system and save it after processing to Magento.

My problem is that when there are more than some amount of records (not many, ~100) coming from the external system my job hangs in the ‘in process’ status.

I am suspecting the database connection, but I have tried multiple ways to make it work such as to inject ResourceConnection on each class constructor I need it, or to create a connection in the beginning of cron job and distribute it (as param) to any place needed, but I had no success.

Also, I am using the ProductInterface in order to identify the product in Magento and I use the set methods to change values and the save method in the end.

Can anyone help me please?
Thank you in advance

PS: I am using magento 2.3.5