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

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

Open
GLWJP opened this issue Sep 4, 2024 · 0 comments
Open

Comments

@GLWJP
Copy link

GLWJP commented Sep 4, 2024

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!

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

No branches or pull requests

1 participant