daniel-widrick / zap2it-GuideScraping

MIT License
59 stars 20 forks source link

Fix cleaning historical guides #36

Closed PseudoResonance closed 4 months ago

PseudoResonance commented 4 months ago

I had the histGuideDays set to 14, but this still ate up all of the storage on my server and caused it to lock up, so I adjusted the historical guide cleanup a bit.

os.stat(fileName).st_mtime returns the Unix timestamp that the file was last modified at, so if we take the current system time and subtract the modified time, it gets the number of seconds passed since the file was modified, which I believe is what you intended. Then I simply checked if it's greater than the maximum historical guide value. Otherwise this has been working great!

daniel-widrick commented 4 months ago

Thank you for the PR. Merged in.