Merge pull request #157 from PepperDash/release/1.2.0

Release to Dev
This commit is contained in:
Andrew Welker
2023-03-01 11:04:47 -07:00
committed by GitHub
3 changed files with 81 additions and 26 deletions

View File

@@ -0,0 +1,37 @@
name: Add bugs to bugs project
on:
issues:
types:
- opened
- labeled
jobs:
check-secret:
runs-on: ubuntu-latest
outputs:
my-key: ${{ steps.my-key.outputs.defined }}
steps:
- id: my-key
if: "${{ env.MY_KEY != '' }}"
run: echo "::set-output name=defined::true"
env:
MY_KEY: ${{ secrets.PROJECT_URL }}
throw-error:
name: Check
runs-on: ubuntu-latest
needs: [check-secret]
if: needs.check-secret.outputs.my-key != 'true'
steps:
- run: echo "The Project URL Repo Secret is empty"
add-to-project:
name: Add issue to project
runs-on: ubuntu-latest
needs: [check-secret]
if: needs.check-secret.outputs.my-key == 'true'
steps:
- uses: actions/add-to-project@main
with:
project-url: ${{ secrets.PROJECT_URL }}
github-token: ${{ secrets.GH_PROJECTS_PASSWORD }}

View File

@@ -312,17 +312,15 @@ namespace PepperDash.Core
/// </summary> /// </summary>
public void Disconnect() public void Disconnect()
{ {
try ConnectEnabled = false;
{ // Stop trying reconnects, if we are
connectLock.Enter(); if (ReconnectTimer != null)
// Stop trying reconnects, if we are {
ReconnectTimer.Stop(); ReconnectTimer.Stop();
KillClient(SocketStatus.SOCKET_STATUS_BROKEN_LOCALLY); ReconnectTimer = null;
} }
finally
{ KillClient(SocketStatus.SOCKET_STATUS_BROKEN_LOCALLY);
connectLock.Leave();
}
} }
/// <summary> /// <summary>
@@ -334,21 +332,41 @@ namespace PepperDash.Core
if (Client != null) if (Client != null)
{ {
try Client.Disconnect();
{ Client = null;
Client.Disconnect(); ClientStatus = status;
Client.Dispose(); Debug.Console(1, this, "Disconnected");
Client = null;
ClientStatus = status;
Debug.Console(1, this, "Disconnected client");
}
catch (Exception ex)
{
Debug.Console(1, this, "Exception killing client: {0}", ex.Message);
}
} }
} }
/// <summary>
/// Anything to do with reestablishing connection on failures
/// </summary>
void HandleConnectionFailure()
{
KillClient(SocketStatus.SOCKET_STATUS_CONNECT_FAILED);
Debug.Console(1, this, "Client nulled due to connection failure. AutoReconnect: {0}, ConnectEnabled: {1}", AutoReconnect, ConnectEnabled);
if (AutoReconnect && ConnectEnabled)
{
Debug.Console(1, this, "Checking autoreconnect: {0}, {1}ms", AutoReconnect, AutoReconnectIntervalMs);
if (ReconnectTimer == null)
{
ReconnectTimer = new CTimer(o =>
{
Connect();
}, AutoReconnectIntervalMs);
Debug.Console(1, this, "Attempting connection in {0} seconds",
(float) (AutoReconnectIntervalMs/1000));
}
else
{
Debug.Console(1, this, "{0} second reconnect cycle running",
(float) (AutoReconnectIntervalMs/1000));
}
}
}
/// <summary> /// <summary>
/// Kills the stream /// Kills the stream
/// </summary> /// </summary>

View File

@@ -53,7 +53,7 @@
</Reference> </Reference>
<Reference Include="SimplSharpCWSHelperInterface, Version=2.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL"> <Reference Include="SimplSharpCWSHelperInterface, Version=2.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpCWSHelperInterface.dll</HintPath> <HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpCWSHelperInterface.dll</HintPath>
</Reference> </Reference>
<Reference Include="SimplSharpHelperInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL"> <Reference Include="SimplSharpHelperInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>