• Michael Hanselmann's avatar
    jqueue: Replace normal cache dict with weakref dict · 5685c1a5
    Michael Hanselmann authored
    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
    5685c1a5
jqueue.py 19.5 KB