Skip to content

Commit

Permalink
CORE-20867: update to the latest api version. some self review updates
Browse files Browse the repository at this point in the history
  • Loading branch information
LWogan committed Nov 11, 2024
1 parent 7a2d71b commit 5c389df
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class ExternalEventRetryRequestHandler : FlowEventHandler<ExternalEventRetryRequ
val now = Instant.now()
val externalEventRetryRequest = context.inputEventPayload
var metaData = context.metadata
val messagingConfig = context.configs.getConfig(ConfigKeys.MESSAGING_CONFIG)
val flowConfig = context.configs.getConfig(ConfigKeys.FLOW_CONFIG)

if (!checkpoint.doesExist) {
log.debug {
Expand Down Expand Up @@ -63,7 +63,7 @@ class ExternalEventRetryRequestHandler : FlowEventHandler<ExternalEventRetryRequ
val expiryTime = getExpiry(metaData)
if (expiryTime == null) {
//first retry so time to set an expiry
metaData = setExpiry(metaData, messagingConfig, now)
metaData = setExpiry(metaData, flowConfig, now)
} else if (retryIsExpired(expiryTime, now)) {
//retry timeout is exceeded so fail the flow
log.debug {
Expand Down Expand Up @@ -97,8 +97,8 @@ class ExternalEventRetryRequestHandler : FlowEventHandler<ExternalEventRetryRequ
return expiry as Long
}

private fun setExpiry(metaData: Metadata?, messagingConfig: SmartConfig, now: Instant): Metadata {
val retryTimeout = retryTimeout(messagingConfig) + now.toEpochMilli()
private fun setExpiry(metaData: Metadata?, flowConfig: SmartConfig, now: Instant): Metadata {
val retryTimeout = retryTimeout(flowConfig) + now.toEpochMilli()
val newEntry = mapOf(CheckpointMetadataKeys.RETRY_EXPIRY to retryTimeout)
if (metaData == null) return Metadata(newEntry)
return Metadata(metaData + newEntry)
Expand Down

1 comment on commit 5c389df

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[stale:lorcan/CORE-20867/retry-topic]

@LWogan The branch lorcan/CORE-20867/retry-topic hasn't been updated in the last 30 days and is marked as stale. It will be removed in 14 days.
If you want to keep this branch around, delete this comment or add new commits to this branch.

Please sign in to comment.