-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
286 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
.../main/scala/pl/touk/nussknacker/ui/process/deployment/ScenarioDeploymentsReconciler.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package pl.touk.nussknacker.ui.process.deployment | ||
|
||
import db.util.DBIOActionInstances.DB | ||
import pl.touk.nussknacker.engine.api.deployment.simple.SimpleStateStatus | ||
import pl.touk.nussknacker.engine.api.deployment.{DataFreshnessPolicy, DeploymentStatusDetails} | ||
import pl.touk.nussknacker.ui.process.deployment.deploymentstatus.{DeploymentStatusesProvider, EngineDeploymentStatus} | ||
import pl.touk.nussknacker.ui.security.api.{LoggedUser, NussknackerInternalUser} | ||
|
||
import scala.concurrent.ExecutionContext | ||
|
||
class ScenarioDeploymentsReconciler(deploymentStatusesProvider: DeploymentStatusesProvider)( | ||
implicit ec: ExecutionContext | ||
) { | ||
|
||
// FIXME abr | ||
def markLocalDeploymentsAsExecutionFinished(): DB[Unit] = { | ||
implicit val user: LoggedUser = NussknackerInternalUser.instance | ||
implicit val freshnessPolicy: DataFreshnessPolicy = DataFreshnessPolicy.Fresh | ||
for { | ||
nonExecutionFinishedDeployments <- | ||
deploymentStatusesProvider.getAllLocallyAvailableNonExecutionFinishedDeployments | ||
actionsIdsToMarkActionAsActionExecutionFinished = nonExecutionFinishedDeployments.collect { | ||
case EngineDeploymentStatus(DeploymentStatusDetails(status, _, _), Some(localDeploymentAction)) | ||
if status == SimpleStateStatus.Finished => | ||
localDeploymentAction.id | ||
} | ||
} yield () | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.