This repository has been archived by the owner on Nov 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 199
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
48 additions
and
9 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
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
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,28 @@ | ||
using System.Threading.Tasks; | ||
using ApiService.OneFuzzLib.Orm; | ||
using Microsoft.Extensions.Logging; | ||
namespace Microsoft.OneFuzz.Service; | ||
|
||
public interface IJobCrashReportedOperations : IOrm<JobCrashReported> { | ||
public Task<bool> CrashReported(Guid jobId); | ||
public Task<OneFuzzResultVoid> ReportCrash(Guid jobId, Guid taskId); | ||
} | ||
|
||
public class JobCrashReportedOperations : Orm<JobCrashReported>, IJobCrashReportedOperations { | ||
public JobCrashReportedOperations(ILogger<NsgOperations> logTracer, IOnefuzzContext context) : base(logTracer, context) { | ||
} | ||
|
||
public async Task<bool> CrashReported(Guid jobId) { | ||
return await QueryAsync(Query.RowKey(jobId.ToString())).AnyAsync(); | ||
} | ||
|
||
public async Task<OneFuzzResultVoid> ReportCrash(Guid jobId, Guid taskId) { | ||
|
||
var result = await Update(new JobCrashReported(jobId, taskId)); | ||
if (!result.IsOk) { | ||
return OneFuzzResultVoid.Error(ErrorCode.UNABLE_TO_UPDATE, "Failed to update job crash reported"); | ||
} | ||
|
||
return OneFuzzResultVoid.Ok; | ||
} | ||
} |
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
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