Skip to content

Commit

Permalink
Do not extract new entities from updated instances
Browse files Browse the repository at this point in the history
  • Loading branch information
wssheldon committed Mar 25, 2024
1 parent 4e213a8 commit 533ca88
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 31 deletions.
26 changes: 0 additions & 26 deletions src/dispatch/signal/flows.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,32 +26,6 @@
log = logging.getLogger(__name__)


def signal_instance_update_flow(
signal_instance_id: int,
db_session: Session = None,
):
"""Create flow used by the API."""
signal_instance = signal_service.get_signal_instance(
db_session=db_session, signal_instance_id=signal_instance_id
)
# fetch `all` entities that should be associated with all signal definitions
entity_types = entity_type_service.get_all(
db_session=db_session, scope=EntityScopeEnum.all
).all()
entity_types = signal_instance.signal.entity_types + entity_types

if entity_types:
entities = entity_service.find_entities(
db_session=db_session,
signal_instance=signal_instance,
entity_types=entity_types,
)
signal_instance.entities = entities
db_session.commit()

return signal_instance


def signal_instance_create_flow(
signal_instance_id: int,
db_session: Session = None,
Expand Down
5 changes: 0 additions & 5 deletions src/dispatch/signal/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,6 @@ def create_signal_instance(
signal_instance = signal_service.update_instance(
db_session=db_session, signal_instance_in=signal_instance_in
)
# Note: we can do this because it's still relatively cheap, if we add more logic to the flow
# this will need to be moved to a background function (similar to case creation)
signal_instance = signal_instance_update_flow(
db_session=db_session, signal_instance_id=signal_instance.id
)
return signal_instance


Expand Down

0 comments on commit 533ca88

Please sign in to comment.