Remove Manganato (for now)

This commit is contained in:
Glax 2025-05-08 03:22:31 +02:00
parent ec5d048df5
commit 1b49b171f4
3 changed files with 6 additions and 9 deletions

View File

@ -25,17 +25,16 @@ internal abstract class DownloadClient
int rateLimit = TrangaSettings.userAgent == TrangaSettings.DefaultUserAgent
? TrangaSettings.DefaultRequestLimits[requestType]
: TrangaSettings.requestLimits[requestType];
Log.Debug($"Request limit {rateLimit}");
TimeSpan timeBetweenRequests = TimeSpan.FromMinutes(1).Divide(rateLimit);
_lastExecutedRateLimit.TryAdd(requestType, DateTime.UtcNow.Subtract(timeBetweenRequests));
TimeSpan rateLimitTimeout = timeBetweenRequests.Subtract(DateTime.UtcNow.Subtract(_lastExecutedRateLimit[requestType]));
DateTime now = DateTime.Now;
_lastExecutedRateLimit.TryAdd(requestType, now.Subtract(timeBetweenRequests));
TimeSpan rateLimitTimeout = timeBetweenRequests.Subtract(now.Subtract(_lastExecutedRateLimit[requestType]));
Log.Debug($"Request limit {rateLimit}/Minute timeBetweenRequests: {timeBetweenRequests} Timeout: {rateLimitTimeout}");
if (rateLimitTimeout > TimeSpan.Zero)
{
Log.Debug($"Timeout: {rateLimitTimeout}");
Thread.Sleep(rateLimitTimeout);
}

View File

@ -117,7 +117,7 @@ using (var scope = app.Services.CreateScope())
new Mangaworld(),
new ManhuaPlus(),
new Weebcentral(),
new Manganato(),
//new Manganato(),
new Global(scope.ServiceProvider.GetService<PgsqlContext>()!)
];
MangaConnector[] newConnectors = connectors.Where(c => !context.MangaConnectors.Contains(c)).ToArray();

View File

@ -135,10 +135,8 @@ public static class Tranga
List<Job> runJobs = context.Jobs.Where(j => j.state <= JobState.Running && j.Enabled == true).ToList()
.Where(j => j.NextExecution < DateTime.UtcNow).ToList();
Log.Debug($"Due jobs: {runJobs.Count}");
Log.Debug($"Running jobs: {RunningJobs.Count}");
IEnumerable<Job> orderedJobs = OrderJobs(runJobs, context).ToList();
Log.Debug($"Ordered jobs: {orderedJobs.Count()}");
Log.Debug($"Jobs Due: {runJobs.Count} Running: {RunningJobs.Count} Ordered: {orderedJobs.Count()}");
foreach (Job job in orderedJobs)
{
// If the job is already running, skip it