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

Only call teardown once per outer block #201

Merged
merged 1 commit into from
Mar 6, 2023

Conversation

schneems
Copy link
Contributor

@schneems schneems commented Mar 6, 2023

The deploy method can be called within the a deploy block. When this happens, teardown! triggers an immediate app deletion which will cause other code within that block to be deleted.

If I could re-write all of this, I would use a different abstraction instead of having App be the god-object. Since I'm living with this existing domain model, we can record the outermost block ID and only fire teardown when that block is exiting. This method ensures that teardown is only ever called once.

The deploy method can be called within the a deploy block. When this happens, `teardown!` triggers an immediate app deletion which will cause other code within that block to be deleted.

If I could re-write all of this, I would use a different abstraction instead of having App be the god-object. Since I'm living with this existing domain model, we can record the outermost block ID and only fire teardown when that block is exiting. This method ensures that teardown is only ever called once.
@schneems schneems force-pushed the schneems/handle-double-teardown branch from 4d8e928 to dc1990a Compare March 6, 2023 20:20
@schneems schneems marked this pull request as ready for review March 6, 2023 20:22
Copy link
Member

@edmorley edmorley left a comment

Choose a reason for hiding this comment

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

Awesome, thank you :-)

@schneems schneems merged commit c461177 into main Mar 6, 2023
@schneems schneems deleted the schneems/handle-double-teardown branch March 6, 2023 20:30
@edmorley edmorley linked an issue Mar 13, 2023 that may be closed by this pull request
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.

Hatchet run failed with Hatchet::Reaper::AlreadyDeletedError
2 participants