Skip to content

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

Open
Jackaed wants to merge 2 commits into
stevearc:masterfrom
Jackaed:master
Open

Dispose of pre-existing tasks before loading in tasks from resession#370
Jackaed wants to merge 2 commits into
stevearc:masterfrom
Jackaed:master

Conversation

@Jackaed

@Jackaed Jackaed commented Oct 9, 2024

Copy link
Copy Markdown

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

@stevearc stevearc left a comment

Copy link
Copy Markdown
Owner

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
Copy Markdown
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