mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-06 17:10:13 +00:00
Misc
This commit is contained in:
@@ -64,7 +64,7 @@ public sealed class ArchiCacheable<T> : IDisposable {
|
|||||||
} catch (OperationCanceledException e) {
|
} catch (OperationCanceledException e) {
|
||||||
ASF.ArchiLogger.LogGenericDebuggingException(e);
|
ASF.ArchiLogger.LogGenericDebuggingException(e);
|
||||||
|
|
||||||
return ReturnFailedValueFor(cacheFallback);
|
return GetFailedValueFor(cacheFallback);
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -75,7 +75,7 @@ public sealed class ArchiCacheable<T> : IDisposable {
|
|||||||
(bool success, T? result) = await ResolveFunction(cancellationToken).ConfigureAwait(false);
|
(bool success, T? result) = await ResolveFunction(cancellationToken).ConfigureAwait(false);
|
||||||
|
|
||||||
if (!success) {
|
if (!success) {
|
||||||
return ReturnFailedValueFor(cacheFallback, result);
|
return GetFailedValueFor(cacheFallback, result);
|
||||||
}
|
}
|
||||||
|
|
||||||
InitializedValue = result;
|
InitializedValue = result;
|
||||||
@@ -85,7 +85,7 @@ public sealed class ArchiCacheable<T> : IDisposable {
|
|||||||
} catch (OperationCanceledException e) {
|
} catch (OperationCanceledException e) {
|
||||||
ASF.ArchiLogger.LogGenericDebuggingException(e);
|
ASF.ArchiLogger.LogGenericDebuggingException(e);
|
||||||
|
|
||||||
return ReturnFailedValueFor(cacheFallback);
|
return GetFailedValueFor(cacheFallback);
|
||||||
} finally {
|
} finally {
|
||||||
InitSemaphore.Release();
|
InitSemaphore.Release();
|
||||||
}
|
}
|
||||||
@@ -110,7 +110,7 @@ public sealed class ArchiCacheable<T> : IDisposable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private (bool Success, T? Result) ReturnFailedValueFor(ECacheFallback cacheFallback, T? result = default) {
|
private (bool Success, T? Result) GetFailedValueFor(ECacheFallback cacheFallback, T? result = default) {
|
||||||
if (!Enum.IsDefined(cacheFallback)) {
|
if (!Enum.IsDefined(cacheFallback)) {
|
||||||
throw new InvalidEnumArgumentException(nameof(cacheFallback), (int) cacheFallback, typeof(ECacheFallback));
|
throw new InvalidEnumArgumentException(nameof(cacheFallback), (int) cacheFallback, typeof(ECacheFallback));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user