Реализация 5 лабораторной работы

This commit is contained in:
2026-11-27 20:06:14 +03:00
parent 276dbdad8a
commit 4fe4ab3432
116 changed files with 11883 additions and 25 deletions
@@ -0,0 +1,13 @@
namespace Messenger.Api.Jobs;
internal static class JobFaultInjection
{
public static void At(string stage, Guid attachmentId, int? attempt = null)
{
var target = attempt is null ? $"{stage}:{attachmentId:D}" : $"{stage}:{attachmentId:D}:{attempt}";
if (Environment.GetEnvironmentVariable("LAB5_TEST_FAULT") != target) return;
Console.Error.WriteLine($"Injected fault {stage} for {attachmentId:D}");
if (stage == "transient") throw new IOException("Injected storage error");
Environment.Exit(71);
}
}