Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
immisterio committed Jan 29, 2024
1 parent f026161 commit 0ea5f62
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 2 additions & 0 deletions Controllers/ApiController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ public JsonResult JacRedConf(string apikey)
[Route("/api/v2.0/indexers/{status}/results")]
public ActionResult Jackett(string apikey, string query, string title, string title_original, int year, Dictionary<string, string> category, int is_serial = -1)
{
//Console.WriteLine(HttpContext.Request.Path + HttpContext.Request.QueryString.Value);

var fastdb = getFastdb();
var torrents = new Dictionary<string, TorrentDetails>();
bool rqnum = !HttpContext.Request.QueryString.Value.Contains("&is_serial=") && HttpContext.Request.Headers.UserAgent.ToString() == "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36";
Expand Down
2 changes: 1 addition & 1 deletion Engine/FileDB/staticDB.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public static IReadOnlyDictionary<string, TorrentDetails> OpenRead(string key, b

var fdb = new FileDB(key);

if (cache && AppInit.conf.evercache.enable)
if (AppInit.conf.evercache.enable && (cache || AppInit.conf.evercache.validHour == 0))
{
var wtm = new WriteTaskModel() { db = fdb, openconnection = 1 };
if (update_lastread)
Expand Down
7 changes: 5 additions & 2 deletions Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@ public static void Main(string[] args)
{
ThreadPool.QueueUserWorkItem(async _ =>
{
await Task.Delay(TimeSpan.FromMinutes(10));
ApiController.getFastdb(update: true);
while (true)
{
await Task.Delay(TimeSpan.FromMinutes(10));
try { ApiController.getFastdb(update: true); } catch { }
}
});

ThreadPool.QueueUserWorkItem(async _ => await SyncCron.Torrents());
Expand Down

0 comments on commit 0ea5f62

Please sign in to comment.