Request Timed Out

I’m encountering a ‘Request Timed Out’ message when submitting a Purchase Invoice. I’ve implemented a function in the on_submit hooks of the Purchase Invoice to update item prices based on the purchase. I’ve also used a queue mechanism in the function to address timeout issues, which works in most cases. However, when trying to submit a lengthy invoice with numerous items, I’m facing this problem. How can I resolve this issue?