Skip to content

Commit

Permalink
Merge pull request LykosAI#516 from ionite34/fix-secrets-manager
Browse files Browse the repository at this point in the history
Fix downloads failing from secretmanager load
  • Loading branch information
ionite34 authored Feb 10, 2024
2 parents 89f0545 + f822f4d commit 55dc469
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ and this project adheres to [Semantic Versioning 2.0](https://semver.org/spec/v2
- Added new package: [Stable Diffusion WebUI Forge](https://github.com/lllyasviel/stable-diffusion-webui-forge) by lllyasviel
- Added extension management for SD.Next and Stable Diffusion WebUI-UX

## v2.8.3
### Fixed
- Fixed user tokens read error causing failed downloads
- Failed downloads will now log error messages

## v2.8.2
### Added
- Added missing GFPGAN link to Automatic1111 packages
Expand Down
2 changes: 2 additions & 0 deletions StabilityMatrix.Core/Models/TrackedDownload.cs
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,8 @@ private void OnDownloadTaskCompleted(Task task)
return;
}

Logger.Warn(Exception, "Download {Download} failed", FileName);

OnProgressStateChanging(ProgressState.Failed);
ProgressState = ProgressState.Failed;
}
Expand Down
2 changes: 1 addition & 1 deletion StabilityMatrix.Core/Services/DownloadService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ private async Task AddConditionalHeaders(HttpClient client, Uri url)
if (url.Host.Equals("civitai.com", StringComparison.OrdinalIgnoreCase))
{
// Add auth if we have it
if (await secretsManager.LoadAsync().ConfigureAwait(false) is { CivitApi: { } civitApi })
if (await secretsManager.SafeLoadAsync().ConfigureAwait(false) is { CivitApi: { } civitApi })
{
logger.LogTrace(
"Adding Civit auth header {Signature} for download {Url}",
Expand Down
6 changes: 1 addition & 5 deletions StabilityMatrix.Core/Services/SecretsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,7 @@ public async Task<Secrets> SafeLoadAsync()
}
catch (Exception e)
{
logger.LogWarning(
e,
"Failed to load secrets ({ExcType}), saving new instance",
e.GetType().Name
);
logger.LogError(e, "Failed to load secrets ({ExcType}), saving new instance", e.GetType().Name);

var secrets = new Secrets();
await SaveAsync(secrets).ConfigureAwait(false);
Expand Down

0 comments on commit 55dc469

Please sign in to comment.