Skip to content

Commit b1b17d7

Browse files
committed
More fixes
1 parent c301320 commit b1b17d7

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

Diff for: service/src/main/kotlin/app/cash/backfila/service/listener/AuditClientListener.kt

+13-13
Original file line numberDiff line numberDiff line change
@@ -16,57 +16,57 @@ class AuditClientListener @Inject constructor(
1616
private val backfilaConfig: BackfilaConfig,
1717
) : BackfillRunListener {
1818
override fun runStarted(id: Id<DbBackfillRun>, user: String) {
19-
val (backfillName, run, description) = transacter.transaction { session ->
19+
val (backfillName, serviceName, description) = transacter.transaction { session ->
2020
val run = session.load<DbBackfillRun>(id)
21-
AuditEvent(run.registered_backfill.name, run, "Backfill started by $user ${dryRunPrefix(run)}${nameAndId(run)}")
21+
AuditEvent(run.registered_backfill.name, serviceName(run), "Backfill started by $user ${dryRunPrefix(run)}${nameAndId(run)}")
2222
}
2323
auditClient.logEvent(
2424
target = backfillName,
2525
description = description,
2626
requestorLDAP = user,
27-
applicationName = serviceName(run),
27+
applicationName = serviceName,
2828
detailURL = idUrl(id),
2929
)
3030
}
3131

3232
override fun runPaused(id: Id<DbBackfillRun>, user: String) {
33-
val (backfillName, run, description) = transacter.transaction { session ->
33+
val (backfillName, serviceName, description) = transacter.transaction { session ->
3434
val run = session.load<DbBackfillRun>(id)
35-
AuditEvent(run.registered_backfill.name, run, "Backfill paused by $user ${dryRunPrefix(run)}${nameAndId(run)}")
35+
AuditEvent(run.registered_backfill.name, serviceName(run), "Backfill paused by $user ${dryRunPrefix(run)}${nameAndId(run)}")
3636
}
3737
auditClient.logEvent(
3838
target = backfillName,
3939
description = description,
4040
requestorLDAP = user,
41-
applicationName = serviceName(run),
41+
applicationName = serviceName,
4242
detailURL = idUrl(id),
4343
)
4444
}
4545

4646
override fun runErrored(id: Id<DbBackfillRun>) {
47-
val (backfillName, run, description) = transacter.transaction { session ->
47+
val (backfillName, serviceName, description) = transacter.transaction { session ->
4848
val run = session.load<DbBackfillRun>(id)
49-
AuditEvent(run.registered_backfill.name, run, "Backfill paused due to error ${dryRunPrefix(run)}${nameAndId(run)}")
49+
AuditEvent(run.registered_backfill.name, serviceName(run), "Backfill paused due to error ${dryRunPrefix(run)}${nameAndId(run)}")
5050
}
5151
auditClient.logEvent(
5252
target = backfillName,
5353
description = description,
5454
automatedChange = true,
55-
applicationName = serviceName(run),
55+
applicationName = serviceName,
5656
detailURL = idUrl(id),
5757
)
5858
}
5959

6060
override fun runCompleted(id: Id<DbBackfillRun>) {
61-
val (backfillName, run, description) = transacter.transaction { session ->
61+
val (backfillName, serviceName, description) = transacter.transaction { session ->
6262
val run = session.load<DbBackfillRun>(id)
63-
AuditEvent(run.registered_backfill.name, run, "Backfill completed ${dryRunPrefix(run)}${nameAndId(run)}")
63+
AuditEvent(run.registered_backfill.name, serviceName(run), "Backfill completed ${dryRunPrefix(run)}${nameAndId(run)}")
6464
}
6565
auditClient.logEvent(
6666
target = backfillName,
6767
description = description,
6868
automatedChange = true,
69-
applicationName = serviceName(run),
69+
applicationName = serviceName,
7070
detailURL = idUrl(id),
7171
)
7272
}
@@ -96,7 +96,7 @@ class AuditClientListener @Inject constructor(
9696

9797
private data class AuditEvent(
9898
val backfillName: String,
99-
val run: DbBackfillRun,
99+
val serviceName: String,
100100
val description: String,
101101
)
102102
}

0 commit comments

Comments
 (0)