Skip to content

Commit

Permalink
Add previous state to state machine transition log
Browse files Browse the repository at this point in the history
  • Loading branch information
emizzle committed Dec 19, 2023
1 parent a83ef5c commit 5777bb7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion codex/utils/asyncstatemachine.nim
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,9 @@ proc scheduler(machine: Machine) {.async.} =
if next =? event(machine.state):
if not running.isNil and not running.finished:
await running.cancelAndWait()
let fromState = if machine.state.isNil: "<none>" else: $machine.state
machine.state = next
debug "enter state", state = machine.state
debug "enter state", state = machine.state, fromState
running = machine.run(machine.state)
running
.track(machine)
Expand Down

0 comments on commit 5777bb7

Please sign in to comment.