Skip to content

Commit

Permalink
initial Job for SR table
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewThien committed Dec 3, 2024
1 parent ca5b985 commit 4d5d61f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions app/workers/UploadQueue/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
UploadStatusType,
)
from shared_code.logger import logger
from shared.jobs.models import Job, JobStage

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "shared_code.django_settings")
import django
Expand Down Expand Up @@ -450,6 +451,15 @@ def main(msg: func.QueueMessage) -> None:
fo_ws = wb.worksheets[0]

table_name_to_id_map = _create_tables(fo_ws, scan_report_id)

# Create the initial Job record for Rules activity stages
for table in table_name_to_id_map:
for stage in ["BUILD_CONCEPTS_FROM_DICT", "REUSE_CONCEPTS", "GENERATE_RULES"]:
Job.objects.create(
scan_report_table=table,
stage=JobStage.objects.get(value=stage),
)

asyncio.run(
_create_fields(fo_ws, wb, scan_report_id, table_name_to_id_map, data_dictionary)
)
Expand Down

0 comments on commit 4d5d61f

Please sign in to comment.