-
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix PR comments: fix test, refactor recurringJobs
- Loading branch information
Showing
14 changed files
with
133 additions
and
28 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace TeacherWorkout.Api.Jobs.Config | ||
{ | ||
public record DeleteOldFileBlobsConfig : RecurringJobConfig | ||
{ | ||
public int DaysInThePast { get; set; } | ||
} | ||
} |
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,8 @@ | ||
namespace TeacherWorkout.Api.Jobs.Config | ||
{ | ||
public record RecurringJobConfig | ||
{ | ||
public bool IsEnabled { get; set; } | ||
public string CronExpression { get; set; } | ||
} | ||
} |
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,20 @@ | ||
using DeUrgenta.RecurringJobs.Jobs.Config; | ||
Check failure on line 1 in TeacherWorkout.Api/Jobs/DeleteOldFileBlobsJob.cs GitHub Actions / build
|
||
using Microsoft.Extensions.Options; | ||
using TeacherWorkout.Api.Jobs.Interfaces; | ||
using TeacherWorkout.Domain.FileBlobs; | ||
|
||
namespace TeacherWorkout.Api.Jobs | ||
{ | ||
|
||
public class DeleteOldFileBlobsJob(IFileBlobRepository repository, IOptions<DeleteOldFileBlobsConfig> config) : IDeleteOldFileBlobsJob | ||
Check failure on line 9 in TeacherWorkout.Api/Jobs/DeleteOldFileBlobsJob.cs GitHub Actions / build
|
||
{ | ||
private readonly IFileBlobRepository _repository = repository; | ||
private readonly DeleteOldFileBlobsConfig _config = config.Value; | ||
Check failure on line 12 in TeacherWorkout.Api/Jobs/DeleteOldFileBlobsJob.cs GitHub Actions / build
|
||
|
||
public void Run() | ||
{ | ||
; | ||
_repository.DeleteOldEntries(_config.DaysInThePast); | ||
} | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
TeacherWorkout.Api/Jobs/Interfaces/IDeleteOldFileBlobsJob.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,10 @@ | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
|
||
namespace TeacherWorkout.Api.Jobs.Interfaces | ||
{ | ||
public interface IDeleteOldFileBlobsJob | ||
{ | ||
void Run(); | ||
} | ||
} |
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 |
---|---|---|
@@ -1,15 +1,15 @@ | ||
Feature: Themes | ||
As a user | ||
I want to be able to list themes | ||
|
||
Scenario: Admin user can create a theme | ||
Given Ion is an admin | ||
When Ion creates a theme | ||
When Ion creates a theme with image | ||
Then the theme was created successfully | ||
|
||
Scenario: Anonymous user can list themes | ||
Given Ion is an admin | ||
And Vasile is an anonymous user | ||
And Ion creates a theme | ||
And Ion creates a theme with image | ||
When Vasile requests themes | ||
Then Vasile receives the theme |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,5 @@ | ||
mutation SingleUpload($file: Upload!) { | ||
singleUpload(file: $file) { | ||
fileBlobId | ||
} | ||
} |
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