Skip to content

Commit

Permalink
Merge pull request #6209 from signalco-io/feat/cloud/keep-warm-functions
Browse files Browse the repository at this point in the history
feat(cloud): Added keep warm functions for all channels and public APIs
  • Loading branch information
AleksandarDev authored Nov 7, 2024
2 parents c1ed8b4 + b2b1347 commit 44f9f6c
Show file tree
Hide file tree
Showing 19 changed files with 145 additions and 1 deletion.
15 changes: 15 additions & 0 deletions cloud/src/Signalco.Api.Public.RemoteBrowser/KeepWarmFunctions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using System;
using Microsoft.Azure.Functions.Worker;
using Microsoft.Extensions.Logging;

namespace Signalco.Api.Public.RemoteBrowser;

public class KeepWarmFunctions
{
[Function("KeepWarm")]
public void Run([TimerTrigger("0 */3 * * * *")] TimerInfo myTimer, FunctionContext context)
{
var logger = context.GetLogger<KeepWarmFunctions>();
logger.LogInformation("C# Timer trigger function executed at: {0}", DateTime.Now);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.23.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Timer" Version="4.3.1" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.18.1" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.OpenApi" Version="1.5.1" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http" Version="3.2.0" />
Expand Down
15 changes: 15 additions & 0 deletions cloud/src/Signalco.Api.Public/Functions/KeepWarmFunctions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using System;
using Microsoft.Azure.Functions.Worker;
using Microsoft.Extensions.Logging;

namespace Signalco.Api.Public.Functions;

public class KeepWarmFunctions
{
[Function("KeepWarm")]
public void Run([TimerTrigger("0 */3 * * * *")] TimerInfo myTimer, FunctionContext context)
{
var logger = context.GetLogger<KeepWarmFunctions>();
logger.LogInformation("C# Timer trigger function executed at: {0}", DateTime.Now);
}
}
1 change: 1 addition & 0 deletions cloud/src/Signalco.Api.Public/Signalco.Api.Public.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<ItemGroup>
<PackageReference Include="Azure.Identity" Version="1.13.1" />
<PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.23.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Timer" Version="4.3.1" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.18.1" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.OpenApi" Version="1.5.1" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http" Version="3.2.0" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using System;
using Microsoft.Azure.Functions.Worker;
using Microsoft.Extensions.Logging;

namespace Signalco.Channel.GitHubApp.Functions;

public class KeepWarmFunctions
{
[Function("KeepWarm")]
public void Run([TimerTrigger("0 */3 * * * *")] TimerInfo myTimer, FunctionContext context)
{
var logger = context.GetLogger<KeepWarmFunctions>();
logger.LogInformation("C# Timer trigger function executed at: {0}", DateTime.Now);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.23.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Timer" Version="4.3.1" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.18.1" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.OpenApi" Version="1.5.1" />
<PackageReference Include="Octokit" Version="13.0.1" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using System;
using Microsoft.Azure.Functions.Worker;
using Microsoft.Extensions.Logging;

namespace Signalco.Channel.PhilipsHue.Functions;

public class KeepWarmFunctions
{
[Function("KeepWarm")]
public void Run([TimerTrigger("0 */3 * * * *")] TimerInfo myTimer, FunctionContext context)
{
var logger = context.GetLogger<KeepWarmFunctions>();
logger.LogInformation("C# Timer trigger function executed at: {0}", DateTime.Now);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.23.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Timer" Version="4.3.1" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.18.1" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.SignalRService" Version="1.15.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.OpenApi" Version="1.5.1" />
Expand Down
15 changes: 15 additions & 0 deletions cloud/src/Signalco.Channel.Samsung/Functions/KeepWarmFunctions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using System;
using Microsoft.Azure.Functions.Worker;
using Microsoft.Extensions.Logging;

namespace Signalco.Channel.Samsung.Functions;

public class KeepWarmFunctions
{
[Function("KeepWarm")]
public void Run([TimerTrigger("0 */3 * * * *")] TimerInfo myTimer, FunctionContext context)
{
var logger = context.GetLogger<KeepWarmFunctions>();
logger.LogInformation("C# Timer trigger function executed at: {0}", DateTime.Now);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.23.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Timer" Version="4.3.1" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.18.1" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.SignalRService" Version="1.15.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.OpenApi" Version="1.5.1" />
Expand Down
15 changes: 15 additions & 0 deletions cloud/src/Signalco.Channel.Slack/Functions/KeepWarmFunctions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using System;
using Microsoft.Azure.Functions.Worker;
using Microsoft.Extensions.Logging;

namespace Signalco.Channel.Slack.Functions;

public class KeepWarmFunctions
{
[Function("KeepWarm")]
public void Run([TimerTrigger("0 */3 * * * *")] TimerInfo myTimer, FunctionContext context)
{
var logger = context.GetLogger<KeepWarmFunctions>();
logger.LogInformation("C# Timer trigger function executed at: {0}", DateTime.Now);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.23.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Timer" Version="4.3.1" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.18.1" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http" Version="3.2.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.OpenApi" Version="1.5.1" />
Expand Down
15 changes: 15 additions & 0 deletions cloud/src/Signalco.Channel.Station/Functions/KeepWarmFunctions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using System;
using Microsoft.Azure.Functions.Worker;
using Microsoft.Extensions.Logging;

namespace Signalco.Channel.Station.Functions;

public class KeepWarmFunctions
{
[Function("KeepWarm")]
public void Run([TimerTrigger("0 */3 * * * *")] TimerInfo myTimer, FunctionContext context)
{
var logger = context.GetLogger<KeepWarmFunctions>();
logger.LogInformation("C# Timer trigger function executed at: {0}", DateTime.Now);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.23.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Timer" Version="4.3.1" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.18.1" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.SignalRService" Version="1.15.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.OpenApi" Version="1.5.1" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using System;
using Microsoft.Azure.Functions.Worker;
using Microsoft.Extensions.Logging;

namespace Signalco.Channel.Zigbee2Mqtt.Functions;

public class KeepWarmFunctions
{
[Function("KeepWarm")]
public void Run([TimerTrigger("0 */3 * * * *")] TimerInfo myTimer, FunctionContext context)
{
var logger = context.GetLogger<KeepWarmFunctions>();
logger.LogInformation("C# Timer trigger function executed at: {0}", DateTime.Now);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.23.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Timer" Version="4.3.1" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.18.1" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.SignalRService" Version="1.15.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.OpenApi" Version="1.5.1" />
Expand Down
15 changes: 15 additions & 0 deletions cloud/src/Signalco.Channel.iRobot/Functions/KeepWarmFunctions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using System;
using Microsoft.Azure.Functions.Worker;
using Microsoft.Extensions.Logging;

namespace Signalco.Channel.iRobot.Functions;

public class KeepWarmFunctions
{
[Function("KeepWarm")]
public void Run([TimerTrigger("0 */3 * * * *")] TimerInfo myTimer, FunctionContext context)
{
var logger = context.GetLogger<KeepWarmFunctions>();
logger.LogInformation("C# Timer trigger function executed at: {0}", DateTime.Now);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.23.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Timer" Version="4.3.1" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.18.1" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.SignalRService" Version="1.15.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.OpenApi" Version="1.5.1" />
Expand Down
2 changes: 1 addition & 1 deletion cloud/src/Signalco.Common.Channel/ConductFunctionsBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ protected class ConductPayloadDto
[JsonPropertyName("valueSerialized")]
public string? ValueSerialized { get; set; }
}
}
}

0 comments on commit 44f9f6c

Please sign in to comment.