Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use a requests session to limit opened sessions
We have some issues with a very high throughput of jobs and Odoo's anonymous sessions. Every job pushed to Odoo uses a new anonymous sessions, which creates a tremendous amount of session files. Using a requests.session means that the session will keep the same cookie once it receives the first response. There is 2 problems with this implementation though: * requests.Session is not proved to be threadsafe [0], but maybe we can manually retrieve the session id and craft the next messages with it. Anyway as they are all anonymous, if we lose a session at some point there is no big deal. * the main issue is that we don't wait for an answer so until we have a requests responding before the timeout we won't have any session id [0] psf/requests#2766
- Loading branch information