Skip to content

Clean up old failed uploads #302

Description

@ckcollab

1)

Make a model manager hiding

Data.upload_completed_successfully = False

Something like how we manage ChaHub users:

class ChaHubUserManager(UserManager):
    def get_queryset(self):
        return super().get_queryset().filter(deleted=False)

    def all_objects(self):
        return super().get_queryset()

2)

Clean up uploads that failed > 3 days ago:

older_than_3_days = now()-timedelta(days=3)

# may need to access model manager differently, like Data.objects.include_unsuccessful ...

Data.objects.filter(upload_completed_successfully=False, created_when__gte=older_than_3_days).delete()

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnhancementFeature suggestions and improvements

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions