-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fixed auto-retry as per this forum post: https://discuss.hangfire.io/t/recurring-jobs-do-not-automatically-get-retried-after-application-crash-net-core-service/9160 * MongoDB can't handle documents greater than 16MB * Treat messages from one id as a group * Kill failing messages over 4 days old * Universal message incrementer * Add testing
- Loading branch information
1 parent
4e88953
commit 1b274be
Showing
24 changed files
with
947 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
namespace SIL.Machine.AspNetCore.Models; | ||
|
||
public enum OutboxMessageMethod | ||
{ | ||
BuildStarted, | ||
BuildCompleted, | ||
BuildCanceled, | ||
BuildFaulted, | ||
BuildRestarting, | ||
InsertPretranslations, | ||
IncrementTranslationEngineCorpusSize | ||
} | ||
|
||
public record OutboxMessage : IEntity | ||
{ | ||
public string Id { get; set; } = ""; | ||
public int Revision { get; set; } = 1; | ||
public required OutboxMessageMethod Method { get; set; } | ||
public required string GroupId { get; set; } | ||
public required string? RequestContent { get; set; } | ||
public DateTimeOffset Created { get; set; } = DateTimeOffset.UtcNow; | ||
public int Attempts { get; set; } = 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
namespace SIL.Machine.AspNetCore.Models; | ||
|
||
public record Sequence : IEntity | ||
{ | ||
public string Id { get; set; } = ""; | ||
|
||
public int Revision { get; set; } | ||
|
||
public string Context { get; set; } = ""; | ||
public int CurrentIndex { get; set; } | ||
|
||
public static string IndexToObjectIdString(int value) | ||
{ | ||
return value.ToString("x24"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
src/SIL.Machine.AspNetCore/Services/IMessageOutboxService.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
namespace SIL.Machine.AspNetCore.Services; | ||
|
||
public interface IMessageOutboxService | ||
{ | ||
public Task<string> EnqueueMessageAsync( | ||
OutboxMessageMethod method, | ||
string groupId, | ||
string requestContent, | ||
CancellationToken cancellationToken | ||
); | ||
} |
Oops, something went wrong.