problem description
there is a function of api: the information currently submitted is b and the database already has an information, that is, the specified task c (an and b are triggered regardless of order, and c is triggered as long as the combination exists.
the database used is mongodb
the environmental background of the problems and what methods you have tried
but the processing of this api request is time-consuming. If both an and b request api at the same time, b does not find an api or b in the logical judgment, and then everyone bypasses the judgment condition and enters the database at the same time, without triggering the specified task c
.what result do you expect?
how to handle an and b requests during time-consuming asynchrony, such as adding program locks and queue attempts?
I hope you can give me some advice on the specific technical proposal. Thank you.