Skip to content

Tasks: remove old fileify task #10747

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 1 commit into from
Sep 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 0 additions & 37 deletions readthedocs/projects/tasks/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,43 +14,6 @@
log = structlog.get_logger(__name__)


# TODO: remove `fileify` task after deploy. We keep it for now
# so builds keep working while we deploy the `index_build` task.
@app.task(queue="reindex")
def fileify(version_pk, commit, build, search_ranking, search_ignore):
"""
Create ImportedFile objects for all of a version's files.

This is so we have an idea of what files we have in the database.
"""
version = Version.objects.get_object_or_log(pk=version_pk)
if not version:
return
project = version.project

if not commit:
log.warning(
'Search index not being built because no commit information',
project_slug=project.slug,
version_slug=version.slug,
)
return

log.info(
'Creating ImportedFiles',
project_slug=version.project.slug,
version_slug=version.slug,
)
try:
_create_imported_files_and_search_index(
version=version,
search_ranking=search_ranking,
search_ignore=search_ignore,
)
except Exception:
log.exception('Failed during ImportedFile creation')


@app.task(queue="reindex")
def index_build(build_id):
"""Create imported files and search index for the build."""
Expand Down