-
Notifications
You must be signed in to change notification settings - Fork 783
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[cards] Fix config issue permanently. #2205
base: master
Are you sure you want to change the base?
Conversation
- Ensures configs behave consistently with cards.
# Unlink the config file if it exists | ||
if self._config_file_name: | ||
try: | ||
os.unlink(self._config_file_name) | ||
except Exception as e: | ||
pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Earlier we were naively removing the config file when the same config file is referenced for all CardCreators. So this broke configs when many cards are present.
self._increment_completed_counter() | ||
if self.task_finished_decos == self.total_decos_on_step[step_name]: | ||
# Unlink the config file if it exists | ||
if self._config_file_name: | ||
try: | ||
os.unlink(self._config_file_name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now we only remove the config when all the decorators are either done with task_finished or with task_exception
except Exception as e: | ||
pass | ||
self._increment_completed_counter() | ||
if self.task_finished_decos == self.total_decos_on_step[step_name]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: would move this to a function (it's called twice).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor nit but LGTM otherwise.
Testing script to see it works :