Answer the question
In order to leave comments, you need to log in
How to solve the problem of communication with the server that may fall?
Good day)
I am very grateful to you guys for your help, thanks to everyone who answers and thanks in advance to those who answer)
In my previous questions they helped out directly)
Sori that is off topic)
And now the question is the
situation is this
is our site, and there is a site of partners
K sometimes users will come to us, and we will have to send the id of this user to the partner’s site
BUT
the partner’s site can fall (and the bitch falls) at any moment, and xs for how long (from 30 seconds to half an hour)
the question is: how to solve the problem with repetition of sending?
I thought like this:
I will write down all the requests that were unanswered in a temporary table, and I will put on the cron sending everything that is in the table, if there is something there,
but it turned out that if you put the cron every 30 seconds, then it does not load the server sickly - because every time this is overgrown in the database,
tell me some alternative solutions.
It would be great if it would be possible to write down a thread just a "flag" - they say "there are unsent requests...." but not in the database....
Answer the question
In order to leave comments, you need to log in
but it turned out that if you put crons every 30 seconds, then it doesn’t load the server sickly - because every time it is overgrown in the database
Celery. Configure it so that it tries to fulfill requests. If it doesn't work, let's try again.
In general, there are plenty of options. Starting with the banal "add a link to the file" and pull the script once a minute:
cat file | while read line; do if [[ $(curl -so /dev/null ${line} -w %http_code) == "200"; then sed "^$line$/d" file; fi; done
(syntax too lazy to check)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question