Commit c8f94f1
committed
feat: add multipart encoder when uploading (large) files
With the previous implementation of `upload_files`, the SDK was loading
the whole file to be uploaded in the memory and only then sending it
over the socket. This was painfully slow, memory constrained and lacked
real feedback.
Therefore the `requests_toolbelt`'s `MultipartEncoderMonitor` is
introduced in this PR, which keeps the memory consumption under control.
This is quite useful not only for CLI consumers of the SDK, but also for
QFieldCloud `qgis` workers, as the memory does not grow too much when
uploading large files after `package` or `apply_deltas` job.1 parent 1ad452d commit c8f94f1
2 files changed
Lines changed: 29 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
665 | 666 | | |
666 | 667 | | |
667 | 668 | | |
| 669 | + | |
668 | 670 | | |
669 | | - | |
| 671 | + | |
| 672 | + | |
670 | 673 | | |
671 | 674 | | |
672 | | - | |
673 | 675 | | |
674 | 676 | | |
675 | | - | |
| 677 | + | |
676 | 678 | | |
677 | | - | |
| 679 | + | |
| 680 | + | |
678 | 681 | | |
679 | | - | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
680 | 688 | | |
681 | 689 | | |
682 | 690 | | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
683 | 702 | | |
684 | 703 | | |
685 | 704 | | |
| |||
695 | 714 | | |
696 | 715 | | |
697 | 716 | | |
698 | | - | |
699 | | - | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
700 | 721 | | |
701 | 722 | | |
702 | 723 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
0 commit comments