Skip to content

Commit

Permalink
add
Browse files Browse the repository at this point in the history
  • Loading branch information
mski-iksm committed Nov 21, 2023
1 parent ed8a3c1 commit 81ddaaa
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions gokart/task_complete_check.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
from logging import getLogger
from typing import Callable

logger = getLogger(__name__)


def task_complete_check_wrapper(run_func: Callable, complete_check_func: Callable):

def wrapper(*args, **kwargs):
if not complete_check_func():
run_func(*args, **kwargs)
if complete_check_func():
logger.warning(f'{run_func.__name__} is skipped because the task is already completed.')
return
return run_func(*args, **kwargs)

return wrapper

0 comments on commit 81ddaaa

Please sign in to comment.