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

Dispose of pre-existing tasks before loading in tasks from resession #370

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

Conversation

Jackaed
Copy link

@Jackaed Jackaed commented Oct 9, 2024

Disposes of all tasks before loading in tasks from resession. May want to be placed behind an configuration option (I'm happy to implement that if you'd like), but this functionality seems far more sane to me than how it currently works - I don't see why you'd want to preserve pre-existing tasks when switching projects and loading in the tasks for that project.

@github-actions github-actions bot requested a review from stevearc October 9, 2024 10:00
Copy link
Owner

@stevearc stevearc left a comment

Choose a reason for hiding this comment

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

This seems like a fine option to have, but it should be controlled by a config option and shouldn't be the default behavior. There are a lot of different ways that sessions can be used and a lot of different possible tasks that people could be running. We shouldn't terminate them unless explicitly requested.

Comment on lines +25 to +31
while true do
local task = task_list.get_by_index(1)
if task == nil then
break
end
task:dispose(true)
end
Copy link
Owner

Choose a reason for hiding this comment

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

It would be safer to get the tasks with overseer.list_tasks, iterate over those, and dispose each of them.

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