Skip to content

Addresses #5 #18

Closed
wants to merge 6 commits into from
Closed

Addresses #5 #18

wants to merge 6 commits into from

Conversation

itrofimow
Copy link
Contributor

@itrofimow itrofimow commented Jun 9, 2019

#5

Copy link
Contributor

@Bobreshovr Bobreshovr left a 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);
Copy link
Contributor

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?

Copy link
Contributor Author

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

src/Horarium.InMemory/JobInMemoryModel.cs Show resolved Hide resolved
src/Horarium.InMemory/InMemoryRepository.cs Show resolved Hide resolved
public Task<string> GetCronForRecurrentJob(string jobKey)
{
if (!_recurrentJobSettingsStorage.TryGetValue(jobKey, out var settings))
throw new Exception("Не найдены настройки для рекуррентного джоба");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Russian

Copy link
Contributor Author

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;
Copy link
Contributor

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.

Copy link
Contributor Author

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
Copy link
Contributor

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 😭

Copy link
Contributor Author

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

@Bobreshovr
Copy link
Contributor

@itrofimow I will close and open the pull request for test auto build.

@Bobreshovr Bobreshovr closed this Jun 9, 2019
@Bobreshovr Bobreshovr reopened this Jun 9, 2019
@itrofimow itrofimow mentioned this pull request Jun 13, 2019
@Bobreshovr Bobreshovr closed this Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants