Skip to content

Commit

Permalink
Make Job.wait_sync signature match Job.wait (#14074)
Browse files Browse the repository at this point in the history
  • Loading branch information
themylogin authored Jul 24, 2024
1 parent 94ae570 commit 6b49a32
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/middlewared/middlewared/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ async def wait(self, timeout=None, raise_error=False, raise_error_forward_classe
raise CallError(self.error)
return self.result

def wait_sync(self, raise_error=False, timeout=None):
def wait_sync(self, timeout=None, raise_error=False, raise_error_forward_classes=(CallError,)):
"""
Synchronous method to wait for a job in another thread.
"""
Expand All @@ -435,7 +435,7 @@ def done(_):
raise TimeoutError()
if raise_error:
if self.error:
if isinstance(self.exc_info[1], CallError):
if isinstance(self.exc_info[1], raise_error_forward_classes):
raise self.exc_info[1]

raise CallError(self.error)
Expand Down

0 comments on commit 6b49a32

Please sign in to comment.