Skip to content

Commit

Permalink
Added logging when update thread goes to sleep
Browse files Browse the repository at this point in the history
  • Loading branch information
Aemony committed Nov 7, 2023
1 parent 18206be commit e166bdb
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/utility/updater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,14 @@ SKIF_Updater::SKIF_Updater (void)

while (! parent.awake.load ( ))
{
PLOG_DEBUG << "SKIF_UpdaterJob thread going to sleep!";

SleepConditionVariableCS (
&UpdaterPaused, &UpdaterJob,
INFINITE
);

PLOG_DEBUG << "SKIF_UpdaterJob thread woke up!";
}

} while (! SKIF_Shutdown); // Keep thread alive until exit
Expand Down Expand Up @@ -205,7 +209,7 @@ SKIF_Updater::PerformUpdateCheck (results_s& _res)
if (! forcedUpdateCheck && _registry.iCheckForUpdates != 0 && ! _registry.bLowBandwidthMode)
{
// Download files if any does not exist or if we're forcing an update
if (! PathFileExists (path_repo.c_str()) || ! PathFileExists (path_patreon.c_str()) || _registry.iCheckForUpdates == 2)
if (_registry.iCheckForUpdates == 2 || ! PathFileExists (path_repo.c_str()) || ! PathFileExists (path_patreon.c_str()))
{
downloadNewFiles = true;
}
Expand Down Expand Up @@ -332,8 +336,8 @@ SKIF_Updater::PerformUpdateCheck (results_s& _res)
return;
}

std::wstring wsCurrentBranch = _registry.wsUpdateChannel;
std:: string currentBranch = SK_WideCharToUTF8 (wsCurrentBranch);
std::wstring wsCurrentBranch = _registry.wsUpdateChannel;
std:: string currentBranch = SK_WideCharToUTF8 (wsCurrentBranch);
static std::wstring wsPreviousBranch = wsCurrentBranch;

bool changedUpdateChannel = (wsPreviousBranch != wsCurrentBranch);
Expand Down

0 comments on commit e166bdb

Please sign in to comment.