Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

1

Is there a function (or variable) that returns the worker count?

By
Michael St-Georges
on 8/24/14, 7:29 PM 1,058 views

Is there a function (or variable) that returns the worker variable as set by the config file or startup option? Ideally something that would be XML-RPC compatible.

worker variable ? Your question is not clear. Please explain waht you want to get.

ThackerS (ts)
on 8/24/14, 10:31 PM

There is a worker configuration directive (or runtime option) to allow OpenERP/Odoo to run in multi-threaded mode. I would like to get the value of this setting. I have an application that creates a huge bunch of sales order line via XMLRPC and would like to process them in parallel, but I would like the application to know how many threads it could request at once.

Michael St-Georges
on 8/25/14, 12:27 PM
0
Michael St-Georges
On 8/28/14, 2:14 PM

After much searching in the code I didn't find anything that would return the required value. I created a simple one-liner in web_services.py to achieve the wanted behavior.

Here is what was done:

-Added 'get_workers' to the if in the dispatch method from the common class.

-Added the exp_get_workers defined as such:

def exp_get_workers(self):
        return tools.config.get('workers', 1)

-1
Marek Mosiewicz
On 8/26/14, 7:37 AM

Counting records is not as easy as it seems to be. You cancreate easliy report for it. If you want XML-RCP you need to create it by hand.

 

Marek Mosiewicz

http://consultantodoo.com

What I need is the configured thread concurrency as set by the workers configuration variable (or startup variable). I am building a XML-RPC library for .NET integration and would like to be able to process a few things asynchronously (As this is meant to create hundreds of recordings + a few hundred searches or gets) at the press of a button and knowing the maximum thread concurrency is key for an efficient system.

Michael St-Georges
on 8/28/14, 1:28 PM
I think you can use WSGI to control number of workers. Unfortunetly they are processes not threads, as threads suffer from single lock in Python


2014-08-28 19:28 GMT+02:00 Michael St-Georges <m.stgeorges@mail.odoo.com>:

What I need is the configured thread concurrency as set by the workers configuration variable (or startup variable). I am building a XML-RPC library for .NET integration and would like to be able to process a few things asynchronously (As this is meant to create hundreds of recordings + a few hundred searches or gets) at the press of a button and knowing the maximum thread concurrency is key for an efficient system.

--
Michael St-Georges Sent by Odoo Inc. using Odoo. about Forum Post False

Marek Mosiewicz
on 8/28/14, 3:18 PM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

4 follower(s)

Stats

Asked: 8/24/14, 7:29 PM
Seen: 1058 times
Last updated: 3/16/15, 8:10 AM