Skip to content

Commit

Permalink
[Fix] Periodic processes repository - process input config fix (#7495)
Browse files Browse the repository at this point in the history
  • Loading branch information
mgoworko committed Jan 24, 2025
1 parent de47aaf commit 08a060d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -505,10 +505,7 @@ class PeriodicProcessService(
)
}
inputConfigDuringExecutionJsonOpt <- periodicProcessesRepository
.fetchInputConfigDuringExecutionJson(
processName,
versionId,
)
.fetchInputConfigDuringExecutionJson(deployment.periodicProcess.id)
.run
inputConfigDuringExecutionJson = inputConfigDuringExecutionJsonOpt.getOrElse {
throw new PeriodicProcessException(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -420,9 +420,9 @@ class SlickLegacyPeriodicProcessesRepository(
): Future[Option[(CanonicalProcess, ProcessVersion)]] =
fetchingProcessRepository.getCanonicalProcessWithVersion(processName, versionId)(NussknackerInternalUser.instance)

def fetchInputConfigDuringExecutionJson(processName: ProcessName, versionId: VersionId): Action[Option[String]] =
def fetchInputConfigDuringExecutionJson(periodicProcessId: PeriodicProcessId): Action[Option[String]] =
PeriodicProcessesWithJson
.filter(p => p.processName === processName && p.processVersionId === versionId)
.filter(p => p.id === periodicProcessId)
.map(_.inputConfigDuringExecutionJson)
.result
.headOption
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,7 @@ trait PeriodicProcessesRepository {
): Action[PeriodicProcessDeployment]

def fetchInputConfigDuringExecutionJson(
processName: ProcessName,
versionId: VersionId
periodicProcessId: PeriodicProcessId,
): Action[Option[String]]

def fetchCanonicalProcessWithVersion(
Expand Down Expand Up @@ -496,9 +495,9 @@ class SlickPeriodicProcessesRepository(
update.map(_ => ())
}

def fetchInputConfigDuringExecutionJson(processName: ProcessName, versionId: VersionId): Action[Option[String]] =
def fetchInputConfigDuringExecutionJson(periodicProcessId: PeriodicProcessId): Action[Option[String]] =
PeriodicProcessesWithInputConfig
.filter(p => p.processName === processName && p.processVersionId === versionId)
.filter(p => p.id === periodicProcessId)
.map(_.inputConfigDuringExecutionJson)
.result
.headOption
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -354,8 +354,7 @@ class InMemPeriodicProcessesRepository(processingType: String) extends PeriodicP
}

override def fetchInputConfigDuringExecutionJson(
processName: ProcessName,
versionId: VersionId
periodicProcessId: PeriodicProcessId,
): Future[Option[String]] =
Future.successful(Some("{}"))

Expand Down

0 comments on commit 08a060d

Please sign in to comment.