-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add complete_check_at_run parameter (#333)
* add * add * add
- Loading branch information
Showing
3 changed files
with
83 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +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 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters