SeeedJP / Wio_Link

Wio_Link 8266
http://seeed-studio.github.io/Wio_Link/
0 stars 0 forks source link

RuntimeError: OrderedDict mutated during iteration #2

Closed matsujirushi closed 2 years ago

matsujirushi commented 2 years ago

サーバーのログに、エラーが記録されている。

[E 220204 01:22:15 ioloop:638] Exception in callback <bound method CacheInventory.housekeeper of <cache.CacheInventory object at 0x7feaba363430>>
    Traceback (most recent call last):
      File "/usr/local/lib/python3.8/dist-packages/tornado/ioloop.py", line 1026, in _run
        return self.callback()
      File "/home/azureuser/Wio_Link/cache.py", line 158, in housekeeper
        for name, item in self._cache.items():
    RuntimeError: OrderedDict mutated during iteration
matsujirushi commented 2 years ago

_cacheでループ中に、

https://github.com/SeeedJP/Wio_Link/blob/master/cache.py#L158

for name, item in self._cache.items():

popしている。

https://github.com/SeeedJP/Wio_Link/blob/master/cache.py#L100

self._cache.pop(item.name)