Skip to content
Snippets Groups Projects
Commit bcd4c90a authored by Nicolas Martinelli's avatar Nicolas Martinelli Committed by Nicolas Martinelli
Browse files

[FIX] web: `get_file` and CPU time exceeded

- Create a binary field which takes some time for computation. For
example:
```
ding_dong = fields.Binary(compute='_compute_ding_dong')

def _compute_ding_dong(self):
    if not self.env.context.get('bin_size'):
        while True:
            3*3
    for x in self:
        x.ding_dong = x.product_id.image_medium
```
- Run the server with a limited CPU time, for example:
  `--workers=2 --limit-time-cpu=10`
- Download the file

A JS traceback occurs, without any information about the real crash.

The error management is simply not working: `JSON.parse` is called on a
string which is not JSON-parseable.

opw-1838832
parent da27836f
Branches
Tags
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment