Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bundle Caching][Shared] Create table to store bundle caching configurations #2034

Closed
Tracked by #2037 ...
JerrySentry opened this issue Jul 4, 2024 · 0 comments · Fixed by codecov/shared#283
Closed
Tracked by #2037 ...
Assignees

Comments

@JerrySentry
Copy link

JerrySentry commented Jul 4, 2024

Create table "bundle_analysis_cacheconfig" with columns

class CacheConfig(models.Model):
    id = models.BigAutoField(primary_key=True)
    repo_id = models.IntegerField()
    bundle_name = models.CharField()
    is_caching = models.BooleanField(null=False, default=True)

make sure to create a new app "bundle_analysis" under "shared/django_apps"

Create a service class that can store values into the table:

class BundleAnalysisCacheConfigService:

    @staticmethod
    def update_cache_option(repo_id, name, is_caching=True):
        if CacheConfig.objects.filter(repo_id, name) is empty:
            CacheConfig.objects.create(repo_id, name, is_caching)

@JerrySentry JerrySentry self-assigned this Jul 4, 2024
@JerrySentry JerrySentry changed the title [Bundle Caching] Create table to store bundle caching configurations [Bundle Caching][Shared] Create table to store bundle caching configurations Jul 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant