bots-edi / bots

Bots EDI Translator
GNU General Public License v3.0
138 stars 83 forks source link

cleanrunsnothingreceive problem if setting over 24h #49

Open bugsbriez opened 6 years ago

bugsbriez commented 6 years ago

Hello

We hit a problem in production, we wanted to keep 3 day of empty run (for week end analysis) and set hoursrunwithoutresultiskept at 72

And we ended with nothing purge

After a quick lookup at cleanup.py, I'v seen that the function _cleanrunsnothingreceived() do not purge entry older than 25h

It will be better to replace : onlycheckrunsofoneday = datetime.datetime.today() - datetime.timedelta(hours=25)

By : onlycheckrunsofoneday = datetime.datetime.today() - datetime.timedelta(hours=(botsglobal.ini.getint('settings','hoursrunwithoutresultiskept',1)+1))