Skip to content

Commit

Permalink
Fix item graph recursive query and re-enable event sending (#15533)
Browse files Browse the repository at this point in the history
  • Loading branch information
mkalish authored Aug 7, 2024
1 parent b35641b commit e5259bc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import gov.cdc.prime.router.Topic
import gov.cdc.prime.router.azure.db.enums.TaskAction
import gov.cdc.prime.router.azure.db.tables.pojos.ReportFile
import gov.cdc.prime.router.azure.observability.context.withLoggingContext
import gov.cdc.prime.router.common.Environment
import org.apache.logging.log4j.kotlin.Logging
import org.hl7.fhir.r4.model.Bundle
import java.util.UUID
Expand Down Expand Up @@ -38,10 +37,6 @@ abstract class AbstractReportStreamEventBuilder<T : AzureCustomEvent>(
private val pipelineStepName: TaskAction,
) : Logging {

companion object {
val sendEventEnabled = Environment.isLocal()
}

constructor(
reportEventService: IReportStreamEventService,
azureEventService: AzureEventService,
Expand Down Expand Up @@ -97,11 +92,9 @@ abstract class AbstractReportStreamEventBuilder<T : AzureCustomEvent>(
}

fun send() {
if (sendEventEnabled) {
val event = buildEvent()
sendToAzure(event)
logEvent(event)
}
}

private fun sendToAzure(event: T): AbstractReportStreamEventBuilder<T> {
Expand Down
9 changes: 2 additions & 7 deletions prime-router/src/main/kotlin/history/db/ReportGraph.kt
Original file line number Diff line number Diff line change
Expand Up @@ -312,13 +312,8 @@ class ReportGraph(
)
.from(ITEM_LINEAGE)
.where(
ITEM_LINEAGE.CHILD_REPORT_ID.`in`(
DSL.select(REPORT_FILE.REPORT_ID)
.from(REPORT_FILE)
.where(ITEM_LINEAGE.CHILD_REPORT_ID.eq(childId))
.and(ITEM_LINEAGE.CHILD_INDEX.eq(childIndex))
)
)
ITEM_LINEAGE.CHILD_REPORT_ID.eq(childId)
).and(ITEM_LINEAGE.CHILD_INDEX.eq(childIndex))
return DSL
.name(ItemGraphTable.ITEM_GRAPH.name)
.`as`(
Expand Down

0 comments on commit e5259bc

Please sign in to comment.