Skip to content

Commit

Permalink
Fix multipart chunksize (#314)
Browse files Browse the repository at this point in the history
* fix multipart chunksize

* change size field to big integer

* fix default chunksize
  • Loading branch information
danangmassandy authored Dec 15, 2024
1 parent c0c9f49 commit c406d37
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 4.2.7 on 2024-12-15 19:08

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('gap', '0041_preferences_api_use_x_accel_redirect_and_more'),
]

operations = [
migrations.AlterField(
model_name='datasourcefilecache',
name='size',
field=models.PositiveBigIntegerField(default=0),
),
]
2 changes: 1 addition & 1 deletion django_project/gap/models/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ class DataSourceFileCache(models.Model):
null=True,
blank=True
)
size = models.PositiveIntegerField(default=0)
size = models.PositiveBigIntegerField(default=0)

class Meta:
"""Meta class for DataSourceFileCache."""
Expand Down
2 changes: 1 addition & 1 deletion django_project/gap/models/preferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def user_file_s3_transfer_config() -> TransferConfig:
conf = Preferences.load().user_file_uploader_config
return TransferConfig(
multipart_chunksize=(
conf.get('default_block_size', 500) * 1024 * 1024
conf.get('default_block_size', 500 * 1024 * 1024)
),
use_threads=True,
max_concurrency=(
Expand Down
18 changes: 18 additions & 0 deletions django_project/gap_api/migrations/0006_alter_userfile_size.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 4.2.7 on 2024-12-15 19:08

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('gap_api', '0005_userfile'),
]

operations = [
migrations.AlterField(
model_name='userfile',
name='size',
field=models.PositiveBigIntegerField(default=0),
),
]
2 changes: 1 addition & 1 deletion django_project/gap_api/models/user_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class UserFile(models.Model):
editable=False,
blank=True
)
size = models.IntegerField(default=0)
size = models.PositiveBigIntegerField(default=0)

def _calculate_hash(self):
"""Calculate hash from query params."""
Expand Down

0 comments on commit c406d37

Please sign in to comment.