Skip to content

Commit

Permalink
Removes unused destructured variables across multiple services
Browse files Browse the repository at this point in the history
and test files. This change simplifies code by removing unnecessary
variable declarations that were previously part of destructuring
operations but never used.

The pattern `val (x, _)` has been replaced with `val (x)` where the
second destructured value was not needed.

GitOrigin-RevId: 862906a2550fcf918754fc7051819de1d6621cff
  • Loading branch information
Synesso authored and svc-squareup-copybara committed Nov 29, 2024
1 parent 21b4eb8 commit 85d8ee4
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion misk-aws/src/main/kotlin/misk/jobqueue/sqs/SqsJob.kt
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ internal class SqsJob(
metrics.visibilityTime.labels(queueName.value, queueName.value).set(visibilityTime.toDouble())
}
private fun deleteMessage(queue: ResolvedQueue, message: Message) {
val (deleteDuration, _) = queue.call {
val (deleteDuration) = queue.call {
timed { it.deleteMessage(queue.url, message.receiptHandle) }
}
metrics.sqsDeleteTime.record(
Expand Down
4 changes: 2 additions & 2 deletions misk-aws/src/main/kotlin/misk/jobqueue/sqs/SqsJobConsumer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ internal class SqsJobConsumer @Inject internal constructor(
MDC.put(SQS_JOB_ID_STRUCTURED_MDC, message.id)
MDC.put(SQS_QUEUE_NAME_MDC, message.queueName.value)
MDC.put(SQS_QUEUE_TYPE_MDC, SQS_QUEUE_TYPE)
val (duration, _) = timed { handler.handleJob(message) }
val (duration) = timed { handler.handleJob(message) }
metrics.handlerDispatchTime.record(
duration.toMillis().toDouble(), queue.queueName,
queue.queueName
Expand Down Expand Up @@ -322,7 +322,7 @@ internal class SqsJobConsumer @Inject internal constructor(
try {
MDC.put(SQS_QUEUE_NAME_MDC, messages.first().queueName.value)
MDC.put(SQS_QUEUE_TYPE_MDC, SQS_QUEUE_TYPE)
val (duration, _) = timed { handler.handleJobs(messages) }
val (duration) = timed { handler.handleJobs(messages) }
metrics.handlerDispatchTime.record(
duration.toMillis().toDouble(), queue.queueName,
queue.queueName
Expand Down
2 changes: 1 addition & 1 deletion misk-aws/src/main/kotlin/misk/jobqueue/sqs/SqsJobQueue.kt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ internal class SqsJobQueue @Inject internal constructor(
attributes: Map<String, String>
) {
executeWithTracingAndErrorHandling(queueName, 1) { span: Span, queue: ResolvedQueue ->
val (sendDuration, _) = queue.call { client ->
val (sendDuration) = queue.call { client ->
val sendRequest = SendMessageRequest().apply {
queueUrl = queue.url
messageBody = body
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ internal class DynamoClusterWatcherTask @Inject constructor(
}

private fun updateOurselfInDynamo() {
val (duration, _) = timed {
val (duration) = timed {
val self = cluster.snapshot.self.name
val member = DyClusterMember()
member.name = self
Expand All @@ -72,7 +72,7 @@ internal class DynamoClusterWatcherTask @Inject constructor(
}

internal fun recordCurrentDynamoCluster() {
val (duration, _) = timed {
val (duration) = timed {
val members = mutableSetOf<Member>()
val threshold = clock.instant().minusSeconds(dynamoClusterConfig.stale_threshold_seconds).toEpochMilli()
val request = ScanEnhancedRequest.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ internal class SchemaValidator {
allDbTables.addAll(dbSchema.tables)
}

val (dbOnly, hibernateOnly, _) = splitChildren(
val (dbOnly, hibernateOnly) = splitChildren(
allDbTables.toList(), hibernateSchema.tables
)

Expand Down

0 comments on commit 85d8ee4

Please sign in to comment.