Skip to content

Commit

Permalink
improve upload process, delete before upload.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreagonmon committed Jul 25, 2021
1 parent fd30121 commit 45d3261
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions mpypack/filesync.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,18 +160,19 @@ def sync_dir_remote_with_local(self, compile=False, arch=None, ignore_hidden=Tru
exist_should_delete_files.discard(f)
except: pass
# get must upload file
need_upload_files = []
need_upload_files = set()
dir_count = 0
for local_file in local_files:
if local_file.type == FileEntityType.DIRECTORY:
need_upload_files.append(local_file)
need_upload_files.add(local_file)
dir_count += 1
continue
hash = self.__hash_local_file(local_file, compile)
key = convert_to_pathstr(local_file)
new_file_record[key] = hash
if not (key in file_record and file_record[key] == hash) or (not upload_only_modified):
need_upload_files.append(local_file)
exist_should_delete_files.add(local_file) # delete first, and upload
need_upload_files.add(local_file)
# start upload
total = len(need_upload_files) - dir_count
if delete_exist_file:
Expand Down
2 changes: 1 addition & 1 deletion mpypack/version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

FULL = "0.1.7"
FULL = "0.1.8"

MAJOR, MINOR, PATCH = FULL.split(".")

0 comments on commit 45d3261

Please sign in to comment.