Little fixes and debug database

This commit is contained in:
Serraniel 2018-02-05 20:33:40 +01:00
parent a867b35cad
commit d7bbbeade9
2 changed files with 11 additions and 0 deletions

View file

@ -92,8 +92,13 @@ namespace DML.Application.Classes
}
Logger.Debug("Loading database...");
#if DEBUG
Database = new LiteDatabase(Path.Combine(DataDirectory, "config.debug.db"));
Database.Log.Logging += (message) => Logger.Trace($"LiteDB: {message}");
#else
Database = new LiteDatabase(Path.Combine(DataDirectory, "config.db"));
Database.Log.Logging += (message) => Logger.Trace($"LiteDB: {message}");
#endif
Logger.Debug("Loading settings collection out of database...");
var settingsDB = Database.GetCollection<Settings>("settings");
@ -221,7 +226,11 @@ namespace DML.Application.Classes
}
if (Settings.RescanRequired)
{
Logger.Info("Restting timestamps");
job.KnownTimestamp = 0;
job.Store();
}
}
Settings.RescanRequired = false;

View file

@ -167,6 +167,8 @@ namespace DML.AppCore.Classes
{
Trace("Updating StopTimestamp for next scan...");
StopTimestamp = SweetUtils.DateTimeToUnixTimeStamp(result[result.Count - 1].CreatedAt.UtcDateTime);
KnownTimestamp = StopTimestamp;
Store();
}
Debug($"Fisnished scan of guild {GuildId} channel {ChannelId}.");