Skip to content

Commit 799fd68

Browse files
authored
Merge pull request #345 from nextcloud/limit-fix
Fixes the download limit
2 parents 0c1fe3e + 2ab7466 commit 799fd68

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

lib/Service/GoogleDriveAPIService.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ public function importDriveJob(string $userId): void {
191191
$targetPath = $this->userConfig->getValueString($userId, APPLICATION::APP_ID, 'drive_output_dir', '/Google Drive', lazy:true);
192192
$targetPath = $targetPath ?: '/Google Drive';
193193
$targetSharedPath = $this->userConfig->getValueString($userId, APPLICATION::APP_ID, 'drive_shared_with_me_output_dir', '/Google Drive/Shared with me', lazy:true);
194+
$downloadLimit = $this->userConfig->getValueInt($userId, APPLICATION::APP_ID, 'drive_imported_size', 0, lazy:true) + 500000000;
194195
$targetSharedPath = $targetSharedPath ?: '/Google Drive/Shared with me';
195196

196197
// check if target paths are suitable
@@ -203,10 +204,10 @@ public function importDriveJob(string $userId): void {
203204
? []
204205
: json_decode($directoryProgressStr, true);
205206
try {
206-
// import by batch of 500 Mo
207+
// import by batch of 500 Mb
207208
$result = $this->importFiles(
208209
$userId, $targetPath, $targetSharedPath,
209-
500000000, $directoryProgress
210+
$downloadLimit, $directoryProgress
210211
);
211212
} catch (Exception|Throwable $e) {
212213
$result = [

0 commit comments

Comments
 (0)