Skip to content

Commit

Permalink
Fixing an issue where we aren't paging for critical
Browse files Browse the repository at this point in the history
  • Loading branch information
kevgliss committed Oct 24, 2023
1 parent a753e3e commit 7b491ce
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 22 deletions.
32 changes: 17 additions & 15 deletions src/dispatch/case/flows.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,9 @@ def case_new_create_flow(
create_all_resources=create_all_resources,
)

db_session.add(case)
db_session.commit()

if case.case_priority.page_assignee:
if not service_id:
if case.case_type.oncall_service:
Expand All @@ -210,22 +213,21 @@ def case_new_create_flow(
log.warning(
"Case assignee not paged. No relationship between case type and an oncall service."
)
else:
oncall_plugin = plugin_service.get_active_instance(
db_session=db_session, project_id=case.project.id, plugin_type="oncall"
)
if oncall_plugin:
oncall_plugin.instance.page(
service_id=service_id,
incident_name=case.name,
incident_title=case.title,
incident_description=case.description,
)
else:
log.warning("Case assignee not paged. No plugin of type oncall enabled.")
return case

db_session.add(case)
db_session.commit()
oncall_plugin = plugin_service.get_active_instance(
db_session=db_session, project_id=case.project.id, plugin_type="oncall"
)
if oncall_plugin:
oncall_plugin.instance.page(
service_id=service_id,
incident_name=case.name,
incident_title=case.title,
incident_description=case.description,
)
else:
log.warning("Case assignee not paged. No plugin of type oncall enabled.")
return case

return case

Expand Down
14 changes: 7 additions & 7 deletions src/dispatch/signal/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,13 +240,13 @@ class SignalInstance(Base, TimeStampMixin, ProjectMixin):
signal_name = column_property(select([Signal.name]).where(Signal.id == signal_id))
signal_description = column_property(select([Signal.description]).where(Signal.id == signal_id))

search_vector = Column(
TSVectorType(
"signal_name",
"signal_description",
weights={"signal_name": "A", "signal_description": "B"},
)
)
# search_vector = Column(
# TSVectorType(
# "signal_name",
# "signal_description",
# weights={"signal_name": "A", "signal_description": "B"},
# )
# )


# Pydantic models
Expand Down

0 comments on commit 7b491ce

Please sign in to comment.