Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] Periodic processes repository - process input config fix #7495

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -418,9 +418,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
Loading