Skip to content

Build: don't track changed files #7874

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

Merged
merged 2 commits into from
Mar 17, 2021
Merged

Build: don't track changed files #7874

merged 2 commits into from
Mar 17, 2021

Conversation

stsewd
Copy link
Member

@stsewd stsewd commented Jan 27, 2021

We aren't caching per file,
and to do this we are tracking the md5 for each file.
Which involves reading te file, calculate the md5, and query the db for
each html file.

We also don't need the HTMLFile model at all..
But, we can remove that in another PR (#7875),
this should help to make indexing fast.

Less and faster code.

We aren't caching per file,
and to do this we are tracking the md5 for each file.
Which involves reading te file, calculate the md5, and query the db for
each html file.

We also don't need the HTMLFile model at all..
But, we can remove that in another PR,
this should help to make indexing fast.
Copy link
Member

@ericholscher ericholscher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense to me. I feel like we were using logic for some other reason, but I can't remember what it was. We should verify in the DB nobody has cdn_enabled set.

The embed UI is the only other place I remember using ImportedFile's, but we only want HTMLFile's there too.

@stsewd
Copy link
Member Author

stsewd commented Jan 28, 2021

We should verify in the DB nobody has cdn_enabled set.

We aren't using that attribute in the code base (-ext and .com). But here are results from the db

.org

In [3]: Project.objects.filter(cdn_enabled=True).count()
Out[3]: 2

In [5]: Project.objects.filter(cdn_enabled=True).values_list('slug')
Out[5]: <ProjectQuerySetBase [('time-test',), ('write-the-docs',)]>

.com

In [1]: Project.objects.filter(cdn_enabled=True).count()
Out[1]: 0

The embed UI is the only other place I remember using ImportedFile's, but we only want HTMLFile's there too.

Yeah, we don't use imported files that aren't html.

files = version.imported_files.filter(
name__endswith='.html',
).order_by('path')

Copy link
Member

@ericholscher ericholscher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a useful improvement I think. We should next remove the md5 from the DB 👍

@stsewd stsewd merged commit 1302f94 into master Mar 17, 2021
@stsewd stsewd deleted the dont-track-changed-files branch March 17, 2021 15:19
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 this pull request may close these issues.

2 participants