tinyerp / erppeek

A versatile tool for Odoo / OpenERP. *** Forked as Odooly ⟶
https://github.com/tinyerp/odooly
Other
171 stars 99 forks source link

Controlling timeouts #41

Closed maraujop closed 9 years ago

maraujop commented 10 years ago

Hi there,

We are using ERPpeek in a project and it's being wonderful, thanks.

The library is executed in celery tasks, basically background tasks. We have a 300 second hard time limit set in celery that kills the process after that time. It's something you really don't want to see kicking in and apparently the tasks using ERPpeek are reaching the limit easily. This is due to OpenERP rpc api not responding in a timely fashion and also we are not seeing any timeouts, neither mentions to the topic within docs.

is there a way to set a timeout for ERPpeek calls?

Thanks, cheers Miguel

florentx commented 10 years ago

Did you try setting a default socket timeout before instantiating an ERPpeek Client ? https://docs.python.org/2/library/socket.html#socket.setdefaulttimeout

Tell me if it does the trick.

ericmachine88 commented 10 years ago

Hi Miguel,

I am trying to do something similar using celery and erppeek. Any tips to make this work with celery?

Thanks.

maraujop commented 10 years ago

First, thanks @florentx this has proven to work, It's very useful because we are no longer seeing Celery killing those processes and hanging forever. As a humble advice, I would honestly add it to the official docs of erppeek.

@ericmachine88 Set a timeout as stated previously and everything will be alright. Nothing else is fancy here, let me know if you have any questions.

Cheers, Miguel