-
Notifications
You must be signed in to change notification settings - Fork 12
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add pack in .drone.yml
public Task AddJob(JobDb job) | ||
{ | ||
var wrappedJob = JobInMemoryWrapper.CreateJobInMemoryWrapper(job); | ||
_jobsStorage.AddOrUpdate(job.JobId, wrappedJob, (_, __) => wrappedJob); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
go style? Maybe use (x,y) better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont see much diference TBH, but if you insist - sure
public Task<string> GetCronForRecurrentJob(string jobKey) | ||
{ | ||
if (!_recurrentJobSettingsStorage.TryGetValue(jobKey, out var settings)) | ||
throw new Exception("Не найдены настройки для рекуррентного джоба"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Russian
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Guess i'll fix it in MongoRepository too then
private static readonly Lazy<InMemoryRepository> | ||
Repository = new Lazy<InMemoryRepository>(() => new InMemoryRepository()); | ||
|
||
public static IJobRepository Create() => Repository.Value; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The interface in the factory is not good because of the method Create
every time return one repository.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True this.
I guess then we should just remove the factory - new InMemoryRepository
does the job. What say you?
using System.Threading.Tasks; | ||
using Horarium.Repository; | ||
|
||
namespace Horarium.InMemory |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This class is perfect for unit testing, sorry 😭
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:pepehands:
Some things... you know, they just must be done - i'll cover it with tests at some point - again, when i'll have the time
@itrofimow I will close and open the pull request for test auto build. |
#5