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

Add option to reset 'action after queue completion' after one execution #264

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions agent_scheduler/task_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,12 @@ def __on_completed(self):
if action == "Do nothing":
return

reset_action = getattr(shared.opts, "queue_completion_action_reset", "No")
if reset_action == "Yes":
log.info(f"[AgentScheduler] Resetting queue_completion_action to 'Do nothing'")
setattr(shared.opts, "queue_completion_action", "Do nothing")
shared.opts.save(shared.config_filename)

command = None
if action == "Shut down":
log.info("[AgentScheduler] Shutting down...")
Expand Down
10 changes: 10 additions & 0 deletions scripts/task_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -759,6 +759,16 @@ def enqueue_keyboard_shortcut_ui(**_kwargs):
section=section,
),
)
shared.opts.add_option(
"queue_completion_action_reset",
shared.OptionInfo(
"No",
"Reset 'action after queue completion' to 'Do nothing' after one execution",
gr.Radio,
{"choices": ["No", "Yes"],},
section=section,
),
)


def on_app_started(block: gr.Blocks, app):
Expand Down