Skip to content

Commit

Permalink
fix: execute the ProtocolExecute's jobToRun zio (#8)
Browse files Browse the repository at this point in the history
Signed-off-by: Fabio <Pinheiro>
  • Loading branch information
FabioPinheiro authored and Fabio committed Apr 30, 2024
1 parent 4f1ac3d commit b64a98d
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,9 @@ trait ProtocolExecuterWithServices[-R <: ProtocolExecuter.Services] extends Prot
case Some(value) => authEncrypt(reply)
case None => anonEncrypt(reply)
// TODO forward message
maybeSyncReplyMsg <- reply.to match // TODO improve
case None => ZIO.none
maybeSyncReplyMsg <- reply.to.map(_.toSeq) match // TODO improve
case None => ZIO.logWarning("Have a reply but the field 'to' is missing") *> ZIO.none
case Some(Seq()) => ZIO.logWarning("Have a reply but the field 'to' is empty") *> ZIO.none
case Some(send2DIDs) =>
ZIO
.foreach(send2DIDs)(to =>
Expand All @@ -83,7 +84,7 @@ trait ProtocolExecuterWithServices[-R <: ProtocolExecuter.Services] extends Prot
head.getServiceEndpointAsURIs.headOption // TODO head
case Seq() => None // TODO
}
jobToRun = mURL match
jobToRun <- mURL match
case None => ZIO.logWarning(s"No url to send message")
case Some(url) =>
ZIO.log(s"Send to url: $url") *>
Expand Down

0 comments on commit b64a98d

Please sign in to comment.