Skip to content

Commit

Permalink
Update runner.py
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxHalford committed Oct 7, 2024
1 parent 4139784 commit f38d821
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lea/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,15 @@ def status(self):

@property
def error(self) -> BaseException | None:
return self.future.exception()
if self.future.done() and self.future.exception():
return self.future.exception()
return None

@property
def cost(self) -> float | None:
if result := self.future.result():
return result.cost
return None


class Runner:
Expand Down

0 comments on commit f38d821

Please sign in to comment.