Remove redundant method for uploading editedFiles

This commit is contained in:
Neeraj Gupta 2022-08-26 12:04:41 +05:30
parent 3bcb907f85
commit 5ad1196172
No known key found for this signature in database
GPG key ID: 3C5A1684DC1729E1
2 changed files with 1 additions and 26 deletions

View file

@ -744,18 +744,6 @@ class FilesDB {
return convertToFiles(results);
}
Future<List<File>> getEditedRemoteFiles() async {
final db = await instance.database;
final results = await db.query(
filesTable,
where:
'($columnCollectionID IS NOT NULL AND $columnCollectionID IS NOT -1) AND ($columnUploadedFileID IS NULL OR $columnUploadedFileID IS -1)',
orderBy: '$columnCreationTime DESC',
groupBy: columnLocalID,
);
return convertToFiles(results);
}
Future<List<int>> getUploadedFileIDsToBeUpdated() async {
final db = await instance.database;
final rows = await db.query(

View file

@ -302,12 +302,8 @@ class RemoteSyncService {
final updatedFileIDs = await _db.getUploadedFileIDsToBeUpdated();
_logger.info(updatedFileIDs.length.toString() + " files updated.");
final editedFiles = await _db.getEditedRemoteFiles();
_logger.info(editedFiles.length.toString() + " files edited.");
_completedUploads = 0;
int toBeUploaded =
filesToBeUploaded.length + updatedFileIDs.length + editedFiles.length;
int toBeUploaded = filesToBeUploaded.length + updatedFileIDs.length;
if (toBeUploaded > 0) {
Bus.instance.fire(SyncStatusUpdate(SyncStatus.preparingForUpload));
@ -343,15 +339,6 @@ class RemoteSyncService {
_uploadFile(file, collectionID, futures);
}
for (final file in editedFiles) {
if (_shouldThrottleSync() &&
futures.length >= kMaximumPermissibleUploadsInThrottledMode) {
_logger.info("Skipping some edited files as we are throttling uploads");
break;
}
_uploadFile(file, file.collectionID, futures);
}
try {
await Future.wait(futures);
} on InvalidFileError {