Adding some noise
Adding some noise to ensure that syncing is progressing as it should.
This commit is contained in:
parent
58e046c1f0
commit
f9af985de4
2 changed files with 7 additions and 0 deletions
|
|
@ -68,9 +68,13 @@ class Program
|
||||||
Thread.Sleep(100);
|
Thread.Sleep(100);
|
||||||
if (lastTime - DateTime.Now > TimeSpan.FromSeconds(30))
|
if (lastTime - DateTime.Now > TimeSpan.FromSeconds(30))
|
||||||
{
|
{
|
||||||
|
var start = DateTime.Now;
|
||||||
|
Console.WriteLine("Checking for updates...");
|
||||||
foreach (var syncer in syncers)
|
foreach (var syncer in syncers)
|
||||||
syncer.FetchDatabase().Wait();
|
syncer.FetchDatabase().Wait();
|
||||||
lastTime = DateTime.Now;
|
lastTime = DateTime.Now;
|
||||||
|
var end = DateTime.Now - start;
|
||||||
|
Console.WriteLine($"Check completed. Total Time: {end}");
|
||||||
}
|
}
|
||||||
if (Process.GetProcessesByName("FreeTube").Length > 0) continue;
|
if (Process.GetProcessesByName("FreeTube").Length > 0) continue;
|
||||||
Console.WriteLine("FreeTube has closed and we have updates, we're going to try and update.");
|
Console.WriteLine("FreeTube has closed and we have updates, we're going to try and update.");
|
||||||
|
|
|
||||||
|
|
@ -83,8 +83,11 @@ public class Syncer<T> : ISyncer where T : class, IDataModel, new()
|
||||||
|
|
||||||
if (data.Equals(entry)) continue;
|
if (data.Equals(entry)) continue;
|
||||||
|
|
||||||
|
Console.WriteLine($"Updated Entry for {_dbName}");
|
||||||
_entries.RemoveAll(x => x.EqualId(entry.Id()));
|
_entries.RemoveAll(x => x.EqualId(entry.Id()));
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
Console.WriteLine($"New Entry for {_dbName}");
|
||||||
_entries.Add(entry);
|
_entries.Add(entry);
|
||||||
_isDirty = true;
|
_isDirty = true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue