-
-
Notifications
You must be signed in to change notification settings - Fork 92
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
Invoke-PodeTask #1107
Comments
Hi @ericxin1982, This will be because the Start event is triggered before any of the Runspaces are actually created, so you can load anything additional if required. To have this work, we'll probably need a new Event, something like |
I've created a new Running event which will be triggered soon after the Start one. In the Running event all Runspaces will be open and available. |
Question
A clear and concise description of your question.
Register-PodeEvent -Type Start -Name 'ProjInit' -ScriptBlock {
$connection = GetConnectionString
Write-Host "$([DateTime]::Now)"
$dbpipe = New-SqlConnection $connection
##global state tree setup, then the whole app can reach the db connection by get-podestate
Set-PodeState -Name 'db' -Value @{ 't254' = $dbpipe } | Out-Null
Invoke-PodeTask -name 'xxxxxx' | out-null
}
Hi @Badgerati
I put invoke-podetask inside register-podeevent -type start, and it does not work, I am curious why.
invoke-podetask inside add-poderoute, and inside Add-PodeSchedule, it works fine.
I just try to make invoke-podetask can trigger when start.
It does not support?
Thanks
Eric Xin
The text was updated successfully, but these errors were encountered: