Skip to content

Commit

Permalink
Ensure log creation times aren't from the future
Browse files Browse the repository at this point in the history
  • Loading branch information
pizzaboxer committed Jul 24, 2023
1 parent 7b3eaa5 commit b4bf224
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Bloxstrap/RobloxActivity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,11 @@ public async void StartWatcher()

while (true)
{
logFileInfo = new DirectoryInfo(logDirectory).GetFiles().OrderByDescending(x => x.CreationTime).First();
logFileInfo = new DirectoryInfo(logDirectory)
.GetFiles()
.Where(x => x.CreationTime <= DateTime.Now)
.OrderByDescending(x => x.CreationTime)
.First();

if (logFileInfo.CreationTime.AddSeconds(15) > DateTime.Now)
break;
Expand Down

0 comments on commit b4bf224

Please sign in to comment.