mirror of
https://github.com/C9Glax/tranga.git
synced 2025-05-14 18:33:02 +02:00
Remove Manganato (for now)
This commit is contained in:
parent
ec5d048df5
commit
1b49b171f4
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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();
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user