This repository has been archived on 2023-02-07. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
flamenco-worker/flamenco_worker/json_encoder.py
Sybren A. Stüvel 483b99d340 Placed timing info collector in a separate class
Previously the code was spread out through the `TaskRunner` and
`AbstractCommand` classes. Now it's in a class of its own and properly
tested.

Also, the timing info is now sent as one line in the task log, making it
less spammy.
2019-02-22 10:45:04 +01:00

11 lines
212 B
Python

import json
from . import timing
class JSONEncoder(json.JSONEncoder):
def default(self, o):
if isinstance(o, timing.Timing):
return o.to_json_compat()
return super().default(o)