Skip to content

Commit 920fc2d

Browse files
πŸ“Œ ISSUE-#23: Code improvement
1 parent 4c5dc4c commit 920fc2d

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

β€Ždotflow/core/decorators/retry.pyβ€Ž

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,23 @@
33
from warnings import warn
44

55

6-
def retry(max_retry):
6+
def retry(max_retry: int):
77
warn("The 'retry' decorator is deprecated", DeprecationWarning, stacklevel=2)
88

99
def inside(func):
1010

1111
def wrapper(*args, **kwargs):
1212
attempt = 0
13-
error_output = Exception()
13+
exception = Exception()
1414

1515
while max_retry > attempt:
1616
try:
1717
return func(*args, **kwargs)
1818
except Exception as error:
19-
error_output = error
19+
exception = error
2020
attempt += 1
2121

22-
raise error_output
22+
raise exception
2323

2424
return wrapper
2525
return inside

β€Ždotflow/core/decorators/time.pyβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ def time(func):
77
def inside(*args, **kwargs):
88
start = datetime.now()
99
task = func(*args, **kwargs)
10-
task.set_duration = (datetime.now() - start).total_seconds()
10+
task.set_duration((datetime.now() - start).total_seconds())
1111
return task
1212
return inside

0 commit comments

Comments
Β (0)