Commit 66787b5b authored by ibuler's avatar ibuler

[Update] 修改volume缓存

parent 98027df8
...@@ -10,3 +10,7 @@ def get_cached_volume(sid): ...@@ -10,3 +10,7 @@ def get_cached_volume(sid):
def set_cache_volume(sid, volume): def set_cache_volume(sid, volume):
__volumes_cached[sid] = volume __volumes_cached[sid] = volume
def remove_cache_volume(sid):
__volumes_cached.pop(sid, None)
...@@ -11,7 +11,7 @@ from ..proxy import ProxyServer ...@@ -11,7 +11,7 @@ from ..proxy import ProxyServer
from ..utils import get_logger from ..utils import get_logger
from ..service import app_service from ..service import app_service
from .base import BaseNamespace from .base import BaseNamespace
from .utils import get_cached_volume from .utils import get_cached_volume, remove_cache_volume
BASE_DIR = os.path.dirname(os.path.dirname(__file__)) BASE_DIR = os.path.dirname(os.path.dirname(__file__))
logger = get_logger(__file__) logger = get_logger(__file__)
...@@ -205,3 +205,4 @@ class ElfinderNamespace(BaseNamespace): ...@@ -205,3 +205,4 @@ class ElfinderNamespace(BaseNamespace):
sftp = get_cached_volume(request.sid) sftp = get_cached_volume(request.sid)
if sftp: if sftp:
sftp.close() sftp.close()
remove_cache_volume(request.sid)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment