Newsbot.Collector/Newsbot.Collector.Services/Jobs/GithubWatcherJob.cs

42 lines
1.1 KiB
C#
Raw Normal View History

using Newsbot.Collector.Database.Repositories;
using Newsbot.Collector.Domain.Interfaces;
namespace Newsbot.Collector.Services.Jobs;
public class GithubWatcherJobOptions
{
public string ConnectionString { get; set; } = "";
public bool FeaturePullReleases { get; set; } = false;
public bool FeaturePullCommits { get; set; } = false;
}
public class GithubWatcherJob
{
private IArticlesRepository _articles;
private IDiscordQueueRepository _queue;
private ISourcesRepository _source;
public GithubWatcherJob()
{
_articles = new ArticlesTable("");
_queue = new DiscordQueueTable("");
_source = new SourcesTable("");
}
private void Init(GithubWatcherJobOptions options)
{
_articles = new ArticlesTable(options.ConnectionString);
_queue = new DiscordQueueTable(options.ConnectionString);
_source = new SourcesTable(options.ConnectionString);
}
public void InitAndExecute(GithubWatcherJobOptions options)
{
Init(options);
// query sources for things to pull
// query */release.atom
// query */commits.atom
}
}