TimeSpan CheckInterval = new TimeSpan(0, 10, 0); //once every 10 minutes public override eI6Error Process(string destMobile, string msg, Ix iAll) { using (var x = new LogPreText("DelLog", iAll)) { if (DateTime.UtcNow > (LastCheck + CheckInterval)) { LastCheck = DateTime.UtcNow; long maxSize; if (long.TryParse("_6WhatsAppProcess_Pre_DeleteLogFile.MaxSize".GetConfig(), out maxSize)) { long currentSize = KnownFiles.ioSize(KnownFiles.eKnownFiles.Log); if (currentSize > maxSize) { KnownFiles.ioDelete(KnownFiles.eKnownFiles.Log); } } } return(Child.Process(destMobile, msg, iAll)); } }
public long FileSize() { return(KnownFiles.ioSize(KnownFiles.eKnownFiles.Log)); }