Skip to content

Commit

Permalink
Leftover dosctring and pattern matching entries
Browse files Browse the repository at this point in the history
  • Loading branch information
arbulu89 committed Mar 20, 2024
1 parent 725b169 commit 91f6b85
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
9 changes: 4 additions & 5 deletions lib/trento/databases/database.ex
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,9 @@ defmodule Trento.Databases.Database do
),
do: {:error, :database_not_registered}

# First time that a Database instance is registered, the SAP System starts its registration process.
# First time that a Database instance is registered, the Database starts its registration process.
# Database instances are accepted when the system replication is disabled or when enabled, only if the database
# has a primary role
# When an Application is discovered, the SAP System completes the registration process.
def execute(
%Database{database_id: nil},
%RegisterDatabaseInstance{
Expand Down Expand Up @@ -161,8 +160,8 @@ defmodule Trento.Databases.Database do
]
end

# When a RegisterDatabaseInstance command is received by an existing SAP System aggregate,
# the SAP System aggregate registers the Database instance if it is not already registered
# When a RegisterDatabaseInstance command is received by an existing database aggregate,
# the database aggregate registers the Database instance if it is not already registered
# and updates the health when needed.
def execute(
%Database{instances: instances} = database,
Expand Down Expand Up @@ -217,7 +216,7 @@ defmodule Trento.Databases.Database do
end

# Deregister a database instance and emit a DatabaseInstanceDeregistered
# also potentially emit SapSystemDeregistered and DatabaseDeregistered events
# also potentially emit DatabaseDeregistered events
def execute(
%Database{database_id: database_id} = database,
%DeregisterDatabaseInstance{
Expand Down
5 changes: 1 addition & 4 deletions lib/trento/sap_systems/sap_system.ex
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ defmodule Trento.SapSystems.SapSystem do
end
end

# Restore a SAP system when the database is registered
# Restore a SAP system when the all the requires instances are registered
defp maybe_emit_sap_system_restored_event(
%SapSystem{instances: instances},
%RegisterApplicationInstance{
Expand All @@ -581,9 +581,6 @@ defmodule Trento.SapSystems.SapSystem do
end
end

# Do not restore SAP system if the database is not registered
defp maybe_emit_sap_system_restored_event(%SapSystem{}, %RegisterApplicationInstance{}), do: nil

defp maybe_emit_sap_system_registered_or_updated_event(
%SapSystem{sid: nil, instances: instances},
%RegisterApplicationInstance{
Expand Down

0 comments on commit 91f6b85

Please sign in to comment.