jqueue: Replace normal cache dict with weakref dict
A job should only exist once in memory. After the cache is cleaned, there can still be references to a job somewhere else. If there are multiple instances, one can get updated while a function is waiting for changes on another instance. By using weakref.WeakValueDictionary, which automatically removes instances as soon as there are no strong references to it anymore, we can solve this problem. Reviewed-by: iustinp
Please register or sign in to comment