Skip to content

Commit

Permalink
crash fix, maybe timer fix
Browse files Browse the repository at this point in the history
  • Loading branch information
wiegell committed Dec 4, 2022
1 parent 222b30d commit 9289fee
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion AstroWall/BusinessLayer/ImgWrap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public class ImgWrap : IComparable
public string CreditUrl { get; private set; }

// Log
private Action<string> log = Logging.GetLogger("Updates");
private Action<string> log = Logging.GetLogger("ImgWrap");

public override bool Equals(object o)
{
Expand Down
6 changes: 3 additions & 3 deletions AstroWall/BusinessLayer/Logging.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public class Logging
{

// Formatting
private static string dateFormat = "dd/MM-yy--HH:mm:ss";
public static readonly string dateFormat = "dd/MM-yy--HH:mm:ss";

//Singleton
private static volatile Logging instance;
Expand Down Expand Up @@ -57,8 +57,8 @@ private void pruneLogFile()
string path = General.getLogPath();
if (File.Exists(path))
{
long size = (new FileInfo(path)).Length;
if (size > 5000000) File.Delete(path);
long size = (new FileInfo(path)).Length;
if (size > 5000000) File.Delete(path);
}
}
}
Expand Down
5 changes: 3 additions & 2 deletions AstroWall/BusinessLayer/Wallpaper/Wallpaper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public Wallpaper(ApplicationHandler applicationHandler)

public async Task<bool> RunPostProcessAndSetWallpaperAllScreens(ImgWrap imgWrap)
{
if (!imgWrap.ImgIsGettable) return false;
try
{
// Task wrap to run on non-ui thread
Expand Down Expand Up @@ -200,8 +201,8 @@ public async void wakeCallback(NSNotification not)
// Double check, if prefs have changed since callback set
if (applicationHandler.Prefs.DailyCheck == DailyCheckEnum.Newest)
{
log("Wake, consider checking for new pics, now is: " + DateTime.Now);
log("Next scheduled check: " + applicationHandler.Prefs.NextScheduledCheck);
log("Wake, consider checking for new pics");
log("Next scheduled check: " + applicationHandler.Prefs.NextScheduledCheck.ToString(Logging.dateFormat));
if (lastScheduledCheckFailedToSetWallpaper)
{
log("Last online check was probably during sleep, retrying to set wallpapers in 10 sec");
Expand Down

0 comments on commit 9289fee

Please sign in to comment.