From 0318483b5257047447cd2bc1ef31db4e82b929f2 Mon Sep 17 00:00:00 2001 From: Steven Schattenberg Date: Tue, 4 Nov 2025 15:59:04 -0500 Subject: [PATCH 1/3] Corrected restart adapter cmd to stop then start adapter --- internal/runners/adapters.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/internal/runners/adapters.go b/internal/runners/adapters.go index fe2322f0..c246acc7 100644 --- a/internal/runners/adapters.go +++ b/internal/runners/adapters.go @@ -403,9 +403,13 @@ func (r *AdapterRunner) Restart(in Request) (*Response, error) { name := in.Args[0] - if err := r.service.Stop(name); err != nil { - return nil, err - } + /* Stop the adapter first, ignore any errors */ + r.service.Stop(name); + + /* Then start it, do not ignore errors */ + if err := r.service.Start(name); err != nil { + return nil, err + } return &Response{ Text: fmt.Sprintf("Successfully restarted adapter `%s`", name), From bdf8b08e73f81362be900ca7fd231ef28cb772d2 Mon Sep 17 00:00:00 2001 From: Steven Schattenberg Date: Tue, 4 Nov 2025 16:03:33 -0500 Subject: [PATCH 2/3] Fixed inconsistent white space --- internal/runners/adapters.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/runners/adapters.go b/internal/runners/adapters.go index c246acc7..afd8c6f3 100644 --- a/internal/runners/adapters.go +++ b/internal/runners/adapters.go @@ -403,13 +403,13 @@ func (r *AdapterRunner) Restart(in Request) (*Response, error) { name := in.Args[0] - /* Stop the adapter first, ignore any errors */ - r.service.Stop(name); + /* Stop the adapter first, ignore any errors */ + r.service.Stop(name) - /* Then start it, do not ignore errors */ - if err := r.service.Start(name); err != nil { - return nil, err - } + /* Then start it, do not ignore errors */ + if err := r.service.Start(name); err != nil { + return nil, err + } return &Response{ Text: fmt.Sprintf("Successfully restarted adapter `%s`", name), From 4066488711999dd36d3a4ecaaf23dfde3a7bcc39 Mon Sep 17 00:00:00 2001 From: Steven Schattenberg Date: Wed, 5 Nov 2025 05:58:35 -0500 Subject: [PATCH 3/3] Using restart service instead of start/stop, corrected spelling mistakes --- internal/runners/adapters.go | 6 +----- pkg/services/command_templates.go | 4 ++-- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/internal/runners/adapters.go b/internal/runners/adapters.go index afd8c6f3..9c92b69c 100644 --- a/internal/runners/adapters.go +++ b/internal/runners/adapters.go @@ -403,11 +403,7 @@ func (r *AdapterRunner) Restart(in Request) (*Response, error) { name := in.Args[0] - /* Stop the adapter first, ignore any errors */ - r.service.Stop(name) - - /* Then start it, do not ignore errors */ - if err := r.service.Start(name); err != nil { + if err := r.service.Restart(name); err != nil { return nil, err } diff --git a/pkg/services/command_templates.go b/pkg/services/command_templates.go index cad0f43e..57aeafc4 100644 --- a/pkg/services/command_templates.go +++ b/pkg/services/command_templates.go @@ -69,7 +69,7 @@ func NewCommandTemplate(name string) CommandTemplate { } // Get will return the specified command template from the server. If the -// specified temlate does not exist, this function will return an error. +// specified template does not exist, this function will return an error. func (svc *CommandTemplateService) Get(name string) (*CommandTemplate, error) { logger.Trace() @@ -127,7 +127,7 @@ func (svc *CommandTemplateService) Create(in CommandTemplate) (*CommandTemplate, logger.Trace() // NOTE (hashdigest) The Id must be set to the same value as the name - // otheriwse the document cannot be found later + // otherwise the document cannot be found later in.Id = in.Name body := map[string]CommandTemplate{"mop": in}