mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
gc: take into account local cache
Signed-off-by: Ruslan Kuprieiev <[email protected]>
This commit is contained in:
@@ -17,6 +17,7 @@ from dvc.logger import Logger
|
||||
from dvc.progress import progress
|
||||
from dvc.config import Config
|
||||
from dvc.remote.base import RemoteBase
|
||||
from dvc.remote.local import RemoteLOCAL
|
||||
|
||||
|
||||
class Callback(object):
|
||||
@@ -212,6 +213,7 @@ class RemoteAzure(RemoteBase):
|
||||
|
||||
def gc(self, checksum_infos):
|
||||
used_etags = [info[self.PARAM_ETAG] for info in checksum_infos['azure']]
|
||||
used_etags += [info[RemoteLOCAL.PARAM_MD5] for info in checksum_infos['local']]
|
||||
|
||||
all_blobs = self.blob_service.list_blobs(self.bucket)
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ except ImportError:
|
||||
|
||||
from dvc.logger import Logger
|
||||
from dvc.remote.base import RemoteBase
|
||||
from dvc.remote.local import RemoteLOCAL
|
||||
from dvc.config import Config
|
||||
from dvc.progress import progress
|
||||
|
||||
@@ -190,6 +191,7 @@ class RemoteGS(RemoteBase):
|
||||
|
||||
def gc(self, checksum_infos):
|
||||
used_etags = [info[self.PARAM_ETAG] for info in checksum_infos['gs']]
|
||||
used_etags += [info[RemoteLOCAL.PARAM_MD5] for info in checksum_infos['local']]
|
||||
|
||||
for etag in self._all_etags():
|
||||
if etag in used_etags:
|
||||
|
||||
@@ -11,6 +11,7 @@ except ImportError:
|
||||
|
||||
from dvc.config import Config
|
||||
from dvc.remote.base import RemoteBase
|
||||
from dvc.remote.local import RemoteLOCAL
|
||||
from dvc.exceptions import DvcException
|
||||
from dvc.logger import Logger
|
||||
|
||||
@@ -174,6 +175,7 @@ class RemoteHDFS(RemoteBase):
|
||||
|
||||
def gc(self, checksum_infos):
|
||||
used_checksums = [info[self.PARAM_CHECKSUM] for info in checksum_infos['hdfs']]
|
||||
used_checksums += [info[RemoteLOCAL.PARAM_MD5] for info in checksum_infos['local']]
|
||||
|
||||
for checksum in self._all_checksums():
|
||||
if checksum in used_checksums:
|
||||
|
||||
@@ -17,6 +17,7 @@ from dvc.logger import Logger
|
||||
from dvc.progress import progress
|
||||
from dvc.config import Config
|
||||
from dvc.remote.base import RemoteBase
|
||||
from dvc.remote.local import RemoteLOCAL
|
||||
|
||||
|
||||
class Callback(object):
|
||||
@@ -230,6 +231,7 @@ class RemoteS3(RemoteBase):
|
||||
|
||||
def gc(self, checksum_infos):
|
||||
used_etags = [info[self.PARAM_ETAG] for info in checksum_infos['s3']]
|
||||
used_etags += [info[RemoteLOCAL.PARAM_MD5] for info in checksum_infos['local']]
|
||||
|
||||
for etag in self._all():
|
||||
if etag in used_etags:
|
||||
|
||||
@@ -13,6 +13,7 @@ from dvc.logger import Logger
|
||||
from dvc.utils import copyfile, file_md5
|
||||
from dvc.progress import progress
|
||||
from dvc.remote.base import RemoteBase
|
||||
from dvc.remote.local import RemoteLOCAL
|
||||
from dvc.config import Config
|
||||
from dvc.exceptions import DvcException
|
||||
|
||||
@@ -256,6 +257,7 @@ class RemoteSSH(RemoteBase):
|
||||
|
||||
def gc(self, checksum_infos):
|
||||
used_md5s = [info[self.PARAM_MD5] for info in checksum_infos['ssh']]
|
||||
used_md5s += [info[RemoteLOCAL.PARAM_MD5] for info in checksum_infos['local']]
|
||||
|
||||
for md5 in self._all_md5s():
|
||||
if md5 in used_md5s:
|
||||
|
||||
Reference in New Issue
Block a user