Skip to content
Advertisement

Why does a cron link respond with a delay when it works more than once?

There is a php function that does some database and curl operations. I run this function with a url. Right now I’m doing this manually, but I’ll tie it to crons in the future.

My problem is this. For example, I have a url like below.

domain.com/crons/update_account_data?token=xxx

When I enter to this url, the function I direct inside deletes data from the database and processes data from a different service.

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

What is the reason of this? I want these 3 links that I run at the same time to start operations at the same time.

Advertisement

Answer

I solved the problem. There is no problem when I enter 4 urls as follows. But I still don’t understand why it works delayed 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
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement