Skip to content
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

Reload an operation when it no longer exists in the cache #34

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jnation3406
Copy link
Contributor

This worked for my old operations that were based on the input images. For operations based on the output of other earlier operations this didn't work, but its not clear to me why yet... Ideally the file basenames those operations reference will be the same as the one the earlier operations regenerate since they come from the cache_key which shouldn't change.

instance = self.get_object()
serializer = self.get_serializer(instance)
if instance.status == 'PENDING' and not instance.output:
operation = available_operations().get(instance.name)(instance.input_data)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if an operation is retried but its inputs don't exist yet (because they're also being recreated). Would have to wait or know somehow when the input_data is ready

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I guess in our current system it would "Fail" if the inputs didn't exist at that moment and then be removed from the UI so that isn't great. I was trying to avoid making the getting operation logic more complicated to the point where it checks previous operations being done before attempting, but maybe that is the way to go.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this kinda ties in to the original plan of having recipes that are saved, thats a whole 'nother can of worms

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants