Skip to content

Title: High CPU and Bandwidth Usage When Running Commands Without Context #168

@GLWJP

Description

@GLWJP

Hi,

I am currently using an older version of the software and executing commands using the following method:

params := winrm.DefaultParameters
params.TransportDecorator = func() winrm.Transporter { return &winrm.ClientNTLM{} }
client, err := winrm.NewClientWithParameters(endpoint, "xxx", "xxx", params)
client.RunWithString(pshell, "")

I did not use the context like this:

ctx, cancel := context.WithCancel(context.Background())
defer cancel()

I am experiencing high CPU and bandwidth usage with my current approach. Would switching to the RunWithContextWithString method help resolve this issue?

Thank you for your help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions