Browse Source

fix(mge): fix fast-run cache mismatch

GitOrigin-RevId: a41150f71a
tags/v0.3.2
Megvii Engine Team 5 years ago
parent
commit
b588d93eb0
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      python_module/megengine/_internal/persistent_cache.py

+ 5
- 1
python_module/megengine/_internal/persistent_cache.py View File

@@ -15,6 +15,7 @@ import shelve


from .logconf import get_logger from .logconf import get_logger
from .mgb import _PersistentCache from .mgb import _PersistentCache
from .version import __version__




class _FakeRedisConn: class _FakeRedisConn:
@@ -85,7 +86,10 @@ class PersistentCacheOnServer(_PersistentCache):
return conn return conn


def _make_key(self, category, key): def _make_key(self, category, key):
return b"@".join((self._prefix.encode("ascii"), category.encode("ascii"), key))
prefix_with_version = "{}:MGB{}".format(self._prefix, __version__)
return b"@".join(
(prefix_with_version.encode("ascii"), category.encode("ascii"), key)
)


def put(self, category, key, value): def put(self, category, key, value):
conn = self._conn conn = self._conn


Loading…
Cancel
Save