|
14 | 14 | log = structlog.get_logger(__name__)
|
15 | 15 |
|
16 | 16 |
|
17 |
| -# TODO: remove `fileify` task after deploy. We keep it for now |
18 |
| -# so builds keep working while we deploy the `index_build` task. |
19 |
| -@app.task(queue="reindex") |
20 |
| -def fileify(version_pk, commit, build, search_ranking, search_ignore): |
21 |
| - """ |
22 |
| - Create ImportedFile objects for all of a version's files. |
23 |
| -
|
24 |
| - This is so we have an idea of what files we have in the database. |
25 |
| - """ |
26 |
| - version = Version.objects.get_object_or_log(pk=version_pk) |
27 |
| - if not version: |
28 |
| - return |
29 |
| - project = version.project |
30 |
| - |
31 |
| - if not commit: |
32 |
| - log.warning( |
33 |
| - 'Search index not being built because no commit information', |
34 |
| - project_slug=project.slug, |
35 |
| - version_slug=version.slug, |
36 |
| - ) |
37 |
| - return |
38 |
| - |
39 |
| - log.info( |
40 |
| - 'Creating ImportedFiles', |
41 |
| - project_slug=version.project.slug, |
42 |
| - version_slug=version.slug, |
43 |
| - ) |
44 |
| - try: |
45 |
| - _create_imported_files_and_search_index( |
46 |
| - version=version, |
47 |
| - search_ranking=search_ranking, |
48 |
| - search_ignore=search_ignore, |
49 |
| - ) |
50 |
| - except Exception: |
51 |
| - log.exception('Failed during ImportedFile creation') |
52 |
| - |
53 |
| - |
54 | 17 | @app.task(queue="reindex")
|
55 | 18 | def index_build(build_id):
|
56 | 19 | """Create imported files and search index for the build."""
|
|
0 commit comments