Closed potatoqualitee closed 4 months ago
What situation does this error occur? Can you indicate the steps to reproduce it?
i cache my threads to make things go faster and keep track of convos. this happens when a run uhhh i dunno, maybe takes too long? but ever since adding this it hasnt happened.
https://github.com/potatoqualitee/dbatools.ai/blob/main/public/Invoke-DbaiQuery.ps1#L73
So just talk a bit too fast on this thread, I suppose.
Implicitly waiting for or canceling a Run may not be the user's intention. Sometimes it is better to output an error that is easy to understand than to try to address all errors in the code. Users can write their own error handling in their scripts.
If this is to be incorporated, it would be better to add an optional switch such as -WaitForRunComplete to wait for Run to complete only when the user wants it to. Also, if Run does not complete within the time specified by Timeout, it should return a timeout error rather than canceling the Run.
It is better for the code that waits for Run to complete to call the already existing Wait-ThreadRun function rather than implementing its own loop.
Thank you. How's that?
Thanks! Btw, I accepted Copilots suggestion for Write-Host by accident. Changed it to Verbose, which is my preference. if you prefer Write-Host, let me know.
Thanks! Btw, I accepted Copilots suggestion for Write-Host by accident. Changed it to Verbose, which is my preference. if you prefer Write-Host, let me know.
I like Verbose better too. 😊
Please give me a day or two before merging as I want to do some testing.
No problem, I keep my branch set to this one so it does not interfere with my testing.
LGTM 👍
To handle this error I encountered when reusing threads
Edit: need to fix to account for more
k, done!