Workers activity link to processes
Add a process_id FK to the WorkerActivity model
- Two processes can be concurrents on a same element/worker-version
- e.g. The first process creates a queued activity but the second may PATCH it to a "running" state with its own ID
- This requires a better logic in the PATCH endpoint (with update lock)
- Deleting a process does not remove its related activities, but the FK is set to null
- This should be probably done in an async task (the UPDATE took 2min10 for 4.6M activities on my laptop)
- Activities stats on a corpus can be filtered with the
process_id
flag
Edited by Valentin Rigal