Skip to content

Commit

Permalink
Merge branch 'main' into monitoring
Browse files Browse the repository at this point in the history
  • Loading branch information
Abrynos committed Apr 7, 2024
2 parents f8beb16 + 8e055fe commit 13daf06
Show file tree
Hide file tree
Showing 16 changed files with 225 additions and 176 deletions.
6 changes: 0 additions & 6 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@
"enabled": true
},
"packageRules": [
{
// TODO: <= 3.1 for Mono support, last failed version 6.12, https://steamcommunity.com/groups/archiasf/discussions/1/2997673517556002529
"allowedVersions": "<= 3.1",
"matchManagers": [ "nuget" ],
"matchPackageNames": [ "Microsoft.Extensions.Configuration.Json", "Microsoft.Extensions.Logging.Configuration" ]
},
{
// TODO: <= 1.7.0-rc.1 for invalid response on monitoring endpoint, last failed version 1.8.0-rc.1
"allowedVersions": "<= 1.7.0-rc.1",
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ jobs:
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}

- name: Report Qodana results to GitHub
uses: github/codeql-action/[email protected].9
uses: github/codeql-action/[email protected].10
with:
sarif_file: ${{ runner.temp }}/qodana/results/qodana.sarif.json
2 changes: 1 addition & 1 deletion ASF-ui
Submodule ASF-ui updated 2 files
+9 −9 package-lock.json
+1 −1 package.json
37 changes: 6 additions & 31 deletions ArchiSteamFarm/Core/ASF.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ public static class ASF {

internal static readonly SemaphoreSlim OpenConnectionsSemaphore = new(WebBrowser.MaxConnections, WebBrowser.MaxConnections);

internal static string DebugDirectory => Path.Combine(SharedInfo.DebugDirectory, OS.ProcessStartTime.ToString("yyyy-MM-dd-THH-mm-ss", CultureInfo.InvariantCulture));

internal static ICrossProcessSemaphore? ConfirmationsSemaphore { get; private set; }
internal static ICrossProcessSemaphore? GiftsSemaphore { get; private set; }
internal static ICrossProcessSemaphore? InventorySemaphore { get; private set; }
Expand Down Expand Up @@ -779,36 +781,9 @@ private static async Task UpdateAndRestart() {
await UpdateSemaphore.WaitAsync().ConfigureAwait(false);

try {
// If backup directory from previous update exists, it's a good idea to purge it now
string backupDirectory = Path.Combine(SharedInfo.HomeDirectory, SharedInfo.UpdateDirectory);

if (Directory.Exists(backupDirectory)) {
ArchiLogger.LogGenericInfo(Strings.UpdateCleanup);

for (byte i = 0; (i < WebBrowser.MaxTries) && Directory.Exists(backupDirectory); i++) {
if (i > 0) {
// It's entirely possible that old process is still running, wait a short moment for eventual cleanup
await Task.Delay(5000).ConfigureAwait(false);
}

try {
Directory.Delete(backupDirectory, true);
} catch (Exception e) {
ArchiLogger.LogGenericDebuggingException(e);

continue;
}

break;
}

if (Directory.Exists(backupDirectory)) {
ArchiLogger.LogGenericError(Strings.WarningFailed);

return (false, null);
}

ArchiLogger.LogGenericInfo(Strings.Done);
// If directories from previous update exist, it's a good idea to purge them now
if (!await Utilities.UpdateCleanup(SharedInfo.HomeDirectory).ConfigureAwait(false)) {
return (false, null);
}

ArchiLogger.LogGenericInfo(Strings.UpdateCheckingNewVersion);
Expand Down Expand Up @@ -994,7 +969,7 @@ private static async Task<bool> UpdateFromArchive(Version newVersion, GlobalConf
// We're ready to start update process, handle any plugin updates ready for new version
await PluginsCore.UpdatePlugins(newVersion, true, updateChannel, updateOverride, forced).ConfigureAwait(false);

return Utilities.UpdateFromArchive(zipArchive, SharedInfo.HomeDirectory);
return await Utilities.UpdateFromArchive(zipArchive, SharedInfo.HomeDirectory).ConfigureAwait(false);
}

[PublicAPI]
Expand Down
Loading

0 comments on commit 13daf06

Please sign in to comment.