Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
13283 Lượt xem

I am working on an API to an e-invoicing service, at the moment the incoming part.


It's basically an automated action that requests new vendor bills, creates partner and products and an invoice with invoice lines. 


But there is a limit on requests I can do (30 per minute) so I am trying to make some breaks.




But after the first break I gett this error:



Ảnh đại diện
Huỷ bỏ

Hello, Andreas!Have you solved this problem? I also meet the same problem. How do you solve this porblem?

Câu trả lời hay nhất

I think error is somewhat related to the wait time as it is being raised when the database cursor is trying to get the self._try_lock(). If you can then try to change your logic to:-


  • Fetch the data from e-invoicing system first and then try to write the data at once instead of repeatedly. 
  • If you don't want to change the logic then one way you can hack it to run the cron job every two to three minutes (or whatever suits you well considering the rate limit) and when it reaches the 30 limit you can just write it to DB and then CRON job will run again.



Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 7 25
2350
2
thg 7 25
7832
2
thg 7 25
4226
2
thg 7 25
4008
2
thg 6 25
2601