Requests are slow while inserting external data via cronjob

Hello,

like in this example in the documentation I’m using strapi to fetch external data which gets inserted in my database. The data is fetched every minute using a cronjob. While the conjob is executing, external requests to strapi take very long. Up to 12 seconds like you can see in this video: strapi slow - YouTube

Does anybody has the same problem or knows how to speed up strapi so that the processes run simultaneously?

About the project: I use strapi to fetch the current amount of available parking spots in parking garages of german cities. In the Github repo you’ll find one city: config/functions/scrapers/koeln.js
I plan to monitor about 50 cities, so like 1000 - 1500 entries ️️have to be updated every minute. So it would be nice to find a solution the mentioned problem.

System Information
  • Strapi Version: 3.3.3
  • Operating System: macOS Catalina
  • Database: MySQL
  • Node Version: 12.18.3
  • NPM Version: 6.14.6
  • Yarn Version: —

Hi @mariusbolik did you find solution?

also do you know is it possible to request to run custom function from frontend not just cron job?

Maybe this thread will help you: https://forum.strapi.io/t/what-is-the-best-way-to-bulk-update-entries
To run custom code from frontend: You can create custom code in the ./controller/ directory of an endpoint.

Edit: changed link

Hi @mariusbolik i know about creating custom code in ./controller/ directory, all i can see in documentation is that i can run it with cron job (timer), what i would like is to send command/request from frontend to execute that code.