diff --git a/inngest-core/src/main/kotlin/com/inngest/State.kt b/inngest-core/src/main/kotlin/com/inngest/State.kt index 31c7c8ac..1c92588a 100644 --- a/inngest-core/src/main/kotlin/com/inngest/State.kt +++ b/inngest-core/src/main/kotlin/com/inngest/State.kt @@ -16,12 +16,14 @@ class State(val payloadJson: String) { sb.append(String.format("%02x", byte)) } return sb.toString() - } inline fun getState(hashedId: String): T? = getState(hashedId, T::class.java) - fun getState(hashedId: String, type: Class): T? { + fun getState( + hashedId: String, + type: Class, + ): T? { val mapper = ObjectMapper() val node: JsonNode = mapper.readTree(payloadJson) val stepResult = node.path("steps").get(hashedId) ?: throw StateNotFound() diff --git a/inngest-core/src/main/kotlin/com/inngest/Step.kt b/inngest-core/src/main/kotlin/com/inngest/Step.kt index 11b9a39b..fc6aa5dd 100644 --- a/inngest-core/src/main/kotlin/com/inngest/Step.kt +++ b/inngest-core/src/main/kotlin/com/inngest/Step.kt @@ -25,9 +25,16 @@ class Step(val state: State) { * @param id unique step id for memoization * @param fn the function to run */ - inline fun run(id: String, noinline fn: () -> T): T = run(id, fn, T::class.java) + inline fun run( + id: String, + noinline fn: () -> T, + ): T = run(id, fn, T::class.java) - fun run(id: String, fn: () -> T, type: Class): T { + fun run( + id: String, + fn: () -> T, + type: Class, + ): T { val hashedId = state.getHashFromId(id) try { diff --git a/inngest-spring-boot-demo/build.gradle.kts b/inngest-spring-boot-demo/build.gradle.kts index af6e4c08..722494e5 100644 --- a/inngest-spring-boot-demo/build.gradle.kts +++ b/inngest-spring-boot-demo/build.gradle.kts @@ -33,4 +33,3 @@ dependencyManagement { tasks.withType { useJUnitPlatform() } -