search

Home  >  Q&A  >  body text

Why does cron link cause delayed response time when it works multiple times?

There is a php function that can perform some database and curl operations. I use a url to run this function. Right now I'm running it manually, but in the future I'll tie it to a cron task.

My question is this. For example, I have a url like the following.

domain.com/crons/update_account_data?token=xxx

When I access this url, the function I specify will delete the data from the database and process the data from different services.

I ran this url 3 times at the same time. The data was immediately deleted from the database on the first run. But the second run starts after a certain time (for example, after 10 seconds) and the third run starts after a certain time (for example, after 20 seconds).

What is the reason? I want these 3 links I'm running at the same time to start operating at the same time.

P粉132730839P粉132730839487 days ago602

reply all(1)I'll reply

  • P粉764785924

    P粉7647859242023-09-09 00:10:48

    I solved this problem. When I enter the following 4 urls, there is no problem. However, I still don't understand why it delays execution if they are all the same.

    domain.com/crons/update_account_data?token=xxx
    domain.com/crons/update_account_data_2?token=xxx
    domain.com/crons/update_account_data_3?token=xxx
    domain.com/crons/update_account_data_4?token=xxx

    reply
    0
  • Cancelreply