Skip to content

Commit

Permalink
- fix program freezing for a while, when exiting, before completely s…
Browse files Browse the repository at this point in the history
…hutting down.

- add publish script.
  • Loading branch information
zarstensen committed Mar 13, 2023
1 parent f7e3121 commit 2dfa2bf
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Broadifyer/Broadifyer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
<!--Avalonia doesen't support TrimMode=link currently,but we are working on that https://github.com/AvaloniaUI/Avalonia/issues/6892 -->
<TrimMode>copyused</TrimMode>
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
<PlatformTarget>x64</PlatformTarget>
<PlatformTarget>AnyCPU</PlatformTarget>
<ImplicitUsings>Enable</ImplicitUsings>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<SupportedOSPlatformVersion>10.0.20348.0</SupportedOSPlatformVersion>
<AssemblyVersion>0.3.1.17457</AssemblyVersion>
<AssemblyVersion>0.3.1.36249</AssemblyVersion>
<Version>$(AssemblyVersion)</Version>
<FileVersion>$(AssemblyVersion)</FileVersion>
<ApplicationIcon>Assets\icon.ico</ApplicationIcon>
Expand Down
4 changes: 2 additions & 2 deletions Broadifyer/Models/TwitchNotify.cs
Original file line number Diff line number Diff line change
Expand Up @@ -561,10 +561,11 @@ protected async Task pollThread()
// instead of sleeping for the full PollInterval, the thread sleeps for PollInterval seconds, in 1 second segments.
// this makes sure that if PollInterval is updated, while the thread wait for the next poll,
// the thread will use the new PollInterval value, instead of sleeping for the old PollInterval amount.
// this (&& m_polling) also makes sure the program does not freeze for more than 1 second, when the program is stopped.

int seconds_slept = 0;

while (seconds_slept < PollInterval)
while (seconds_slept < PollInterval && m_polling)
{
seconds_slept++;
Thread.Sleep(1000);
Expand All @@ -577,7 +578,6 @@ protected async Task poll()
{
try
{

List<string> ids = currentStreamers().Where(info => info.Enable).Select(info => info.Streamer.Id).ToList();

// if there are no registered live streamers, simply do nothing and wait for the poll interval,
Expand Down
22 changes: 22 additions & 0 deletions Broadifyer/Publish.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
cls

echo Deleting previous publish

rd /s /q "./bin/Publish/Release/"

echo Publising 'x64 Release'
dotnet publish Broadifyer.csproj /p:PublishProfile="x64 Release"
echo Publising 'x86 Release'
dotnet publish Broadifyer.csproj /p:PublishProfile="x86 Release"

cd "./bin/Publish/Release"

echo Compressing 'x64 Release'
tar -acf Broadifyer-x64.zip x64
echo Compressing 'x86 Release'
tar -acf Broadifyer-x86.zip x86

echo Done!

cd ../../../

0 comments on commit 2dfa2bf

Please sign in to comment.